Grid Custom Aggregate - sum true's on boolean column

1 Answer 319 Views
Grid
Brett
Top achievements
Rank 1
Brett asked on 07 May 2021, 11:57 AM

I have a grid and I want to sum the number of true values in a boolean column. Is there a way to create a custom aggregate function to achieve this?

 

Brett

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 12 May 2021, 06:10 AM

Hi Brett,

If I am not misunderstanding the scenario, you can use the Count aggregate function to get the number of items of the Boolean column that values true and false. Check the Demo we have here https://demos.telerik.com/aspnet-core/grid/aggregates

I hope this helps.

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Brett
Top achievements
Rank 1
commented on 12 May 2021, 06:15 AM

Thanks for the response Aleksander,

You are correct that the count aggregate will count the number of true AND false values. However I am looking to count the number of true values only. If the value is false I don't want to count it.

Brett
Aleksandar
Telerik team
commented on 14 May 2021, 12:23 PM

Hi Brett,

I am not entirely sure I understand the scenario you have. Is it possible that the approach demonstrated in this article would be useful for you?

https://docs.telerik.com/kendo-ui/knowledge-base/grid-custom-aggregate-by-unique-value 

Tags
Grid
Asked by
Brett
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or