3 Replies Latest reply: Jun 10, 2015 3:43 AM by Yasser BENAZZOUZ RSS

    Using a variable for Dimension in Aggregation

    Steve Zagzebski

      I have the following expression:

       

      Sum(
                
      Aggr(
                   
      if(sum({<[Year] = {$(=Max([Year])-1)}>}[Commission])>0,
                      
      sum({<[Year] = {$(=Max([Year]))}>}[Commission]),0),
                                  
      [Policy Type],[Customer Name],[Department Name])

       

      This expression works fine. However where "Department Name" is I want a variable based on a cycle group (which is the dimension in this object). So each time the cycle is changed it is reflected via a variable in the expression above.

       

      What is the best way of doing this?