11 Replies Latest reply: May 1, 2015 2:33 AM by James Kerrigan RSS

    Expression to view previous month data not working

    James Kerrigan

      Hi guys,

       

      In my load statement I have

       

          "Date",

          Month(Date) as "Month",

          Year(Date) as "Year",

          Date(MonthStart(Date), 'MMM-YY') as MonthYear,

          Price

       

      Which works fine. And when I want to view the max MonthYear selected with the expression:

       

      Sum({<MonthYear = {"$(=max(MonthYear))"}>}Price)

       

      That works fine for whichever MonthYear I select. However when I try the expression:

       

      Sum({<MonthYear = {"$(=max(MonthYear)-1)"}>}Price)

       

      It never seems to work as it only returns 0. My max MonthYear is Jan-15, so one before would be Dec-14. Can anyone see what I'm doing wrong? I'm not too good when it comes to this stuff so please let me know if something else doesn't look right.

       

      Thanks in advance.

       

      Also I'm not able to post the file, sorry!