Cusomt AggregateFunction that checks row field

1 posts, 0 answers
  1. Oana
    Oana avatar
    4 posts
    Member since:
    Apr 2018

    Posted 03 Apr 2018 Link to this post

    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!

     

Back to Top