Group By API

Group By API

lassenav@hotmail.comlassenav@hotmail.com Posts: 16Questions: 5Answers: 0

Is there something like...
[SELECT Country, Region, SUM(sales) AS TotalSales FROM Sales GROUP BY Country, Region;] OR
[SELECT Country, Region, COUNT(*) AS CountryRegionCnt FROM Sales GROUP BY Country, Region;]
in DataTables?

Is there some API to call on the DataTables variable that will provide an aggregation(SUM,COUNT,MAX,etc) on only the filtered rows?
(e.g. user clicks button, a count of distinct filtered rows, based on 2 or more columns)
Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,873Questions: 1Answers: 10,528 Site admin
    Answer ✓

    There isn't a built in way of doing a group by, but if you just want to could rows use rows() to select the rows and count() to then count how many were selected.

    Allan

  • lassenav@hotmail.comlassenav@hotmail.com Posts: 16Questions: 5Answers: 0

    Thanks Allen for the prompt response. I will certainly give that a try.

This discussion has been closed.