Custom Aggregate for 5% of Count

2 posts, 0 answers
  1. Matt
    Matt avatar
    6 posts
    Member since:
    Oct 2014

    Posted 09 Sep 2016 Link to this post

    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?


  2. Hristo
    Hristo avatar
    1508 posts

    Posted 13 Sep 2016 Link to this post

    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.
    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.
Back to Top