3 Replies Latest reply: Jul 11, 2013 8:19 AM by konstantins kozins RSS

    Expression formula based on dimension

      Hello,

       

      I have one problem to show data in the pivot table according to the dimension.

       

      Amount:

      load *Inline

      [account, amount, Year Month

      acc_1, 100, 201306

      acc_2, 200, 201306

      acc_3, 300, 201306

      acc_4, 400, 201206

      acc_5, 500, 201206

      acc_6, 600, 201206];

       

      If use the expressions for the current and previous years, the expression works properly.

      TY : sum({<[Year Month] = {'201306'}>}amount)

      PY : sum({<[Year Month] = {'201306'}>}amount)

       

      img1.png

       

      But when I want to show the data with dimension (Actual, Last Year), the expression doesn't working for Last year

      if(D1_no = 10, //Current Year

                sum({<[Year Month] = {'201306'}>}amount),

                if(D1_no = 30, //Last Year

                          sum({<[Year Month] = {'201206'}>}amount)

                )

      )

       

      img2.png