Getting the Count of same entries of data

Getting the Count of same entries of data

alvinmactalalvinmactal Posts: 2Questions: 1Answers: 0
edited July 2017 in Free community support

hi! how can I get the count of same data in the datatable?
for example,

There are 10 students in the table with attributes as Name, Age , Year, Birthdate, Section
And I want to get the total number of ages like 10, 12, 13 in a section.

Basically I want to get the summary of specific field after filtering.

Thank you in advance

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin
    Answer ✓

    What you'd need to do is use rows().data() to get the data for the rows and then loop over them, "binning" the data - i.e. if age === 10, totalAges[10]++; etc.

    Allan

This discussion has been closed.