Grouping on multiple fields

3 posts, 0 answers
  1. Domenico
    Domenico avatar
    1 posts
    Member since:
    Jun 2013

    Posted 23 Dec 2013 Link to this post

    Hi.

    I'm struggling to fit the PivotGrid to my use case and can't seem to find any relevant example.
    Basically, I have two group levels, let's say Product Category (first level) and then Product Name (second level, with each category containing one or more products). The Product Sale Amount is the numeric value I need to group on (Sum). The columns of the pivot will be the sale dates, in months. The problem is that products could be in different currencies, but each product is always in the same currency.
    Would it be possible to have the Level 2 as "Product Name" + "Currency", as two adjacent columns? I can get the currency as a third level but that is not ideal since I need to unnecessarily expand an extra level.
    Also, since it would be incorrect to sum amounts in different currencies, would it be possible to remove (or hide) the "Grand Total" column for Level 1 only?

    Many thanks
    Domenico
  2. Ventzi
    Admin
    Ventzi avatar
    114 posts

    Posted 26 Dec 2013 Link to this post

    Hello Domenico,

    Please expect an answer in the next few days, as we are working with limited capacity due to the Christmas holidays.

    Regards,
    Ventzi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ventzi
    Admin
    Ventzi avatar
    114 posts

    Posted 27 Dec 2013 Link to this post

    Hi Domenico,

    You could hide the Grand Total row by setting the value of the RowGrandTotalsPosition and/or RowSubTotalsPosition properties of the RadPivotGrid to None. In order to achieve "grouping on Sum" you need to create custom AggregateFunction where you should sum all incoming money amounts. If you like to display custom group description like "Product Name" + "Currency", you could create a custom PropertyGroupDescription and to override the GroupNameFromItem method where you should return the custom description. 

    I've prepared and attached a sample project which demonstrates this approach. Please take a look and if you have any further questions, don't hesitate to contact us again.

    Regards,
    Ventzi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top