5 Replies Latest reply: Jan 12, 2016 9:36 PM by Felix Wong RSS

    Using variable in Set Analysis

    Felix Wong

      Currently I'm having a problem to use variables in Set Analysis.

       

      I have set them as below to have 3 variables representing past 3 months.

       

      Set vPastMonth1 = num(Month(AddMonths(Date(Today()),-1)));

      Set vPastMonth2 = num(Month(AddMonths(Date(Today()),-2)));

      Set vPastMonth3 = num(Month(AddMonths(Date(Today()),-3)));

       

       

      And then I'm using them in an expression to get the maximum percentage with past 3 months of 2015:

       

      max({$ <RawMonth={$(vPastMonth1),$(vPastMonth2),$(vPastMonth3)}, RawYear = {2015}>} [Percentage])

       

       

       

      However, it won't count. If I set them to constant like 12,11,10, this expression will work. Further checked the set statement by using a text box, and they are correct. May I know how come they won't work with set analysis? Thank you very much.