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

Grouping on multiple fields

2 Answers 61 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Domenico
Top achievements
Rank 1
Domenico asked on 23 Dec 2013, 01:07 PM
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 Answers, 1 is accepted

Sort by
0
Ventzi
Telerik team
answered on 26 Dec 2013, 03:06 PM
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 >>
0
Ventzi
Telerik team
answered on 27 Dec 2013, 12:27 PM
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 >>
Tags
PivotGrid
Asked by
Domenico
Top achievements
Rank 1
Answers by
Ventzi
Telerik team
Share this question
or