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

Cusomt AggregateFunction that checks row field

0 Answers 56 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Oana
Top achievements
Rank 1
Oana asked on 03 Apr 2018, 04:55 PM

I'm trying to create a custom AggregateFunction that applies different calculations based on the Field that represents the leaf level in the Pivot Grid. It is for a pivot grid that displays revenue for books sold in a library that includes the sum of sold books - a commision difference (the scenario is made up).

View 1:

Selected fields: Library, Categoy, Book

Should display

                        Day 1  
Library              1050
   Fantasy          240 (600-10%)
      Book A        100  
      Book B        200  
      Book C        300  
   Drama            810 (900-10%)
      Book D        400  
      Book E        500

 

View 2:

Selected fields: Library, Categoy
Should display
                        Day 1  
Library              1050
   Fantasy          240 (600-10%)
   Drama            810 (900-10%)

 

In the scenarios above, the -10% needs to be aggregated only on Category level and above, not on Book level. I created a custom aggregate function but wasn't able to find a solution of checking the field that the row to which the aggregate applies belongs to, whether it is Book or Category.

 

Does anybody know how to do this?

Thanks!

 

No answers yet. Maybe you can help?

Tags
PivotGrid
Asked by
Oana
Top achievements
Rank 1
Share this question
or