This is a migrated thread and some comments may be shown as answers.

Custom Aggregate for 5% of Count

1 Answer 40 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 09 Sep 2016, 09:19 PM

I have the following aggregate to calculate the count of people in my data.

 

radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription()
{
PropertyName = "personId",
AggregateFunction = AggregateFunctions.Count
});

 

I want to add a custom aggregate that calculates 5% of the count, always rounding up to the next integer value. For example, if there were 102 people, the customer aggregate would yield 6. (102 * 5% = 5.1 rounded up = 6)

How can I do this?

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 13 Sep 2016, 11:50 AM
Hello Matt,

Thank you for writing.

In order to achieve your task, you would need to create a custom aggregate function. We have a documentation article providing an example: RadPivotGrid | Custom Aggregation.

I hope this information is useful. Should you have further questions please do not hesitate to write back.
 
Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
PivotGrid and PivotFieldList
Asked by
Matt
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or