6 Replies Latest reply: Nov 29, 2016 3:10 AM by Linoy Elias RSS

    Date variable in set analysis

    Linoy Elias

      Hi,

      I have a max date variable ( vMaxDate=Max(Date) ) and I want to use it in set analysis both for calculations for max date and for previous max date.

      The max date works, this is the formula:

      Sum({<DateNum={"$(=$(vMaxDate))"}>} Quantity)

       

      But how do I do it for previous date, without creating another variable?

      This formula DOES NOT work:

      Sum({<DateNum={"$(=$(vMaxDate)-1)"}>} Quantity)

       

      ***if I do it without using variable, it works, but I want to use  a variable.

      Without variable the formula is like this:

      Sum({<DateNum={"$(=Max(DateNum-1))"}>} Quantity)

       

      Thanks