2 Replies Latest reply: Sep 28, 2012 8:15 AM by Stefan Wühl RSS

    how to use date flags after you created the master calendar?

      Hi,

       

      This is a real beginner question.

       

      I have made this standard master calendar (with date island, data variables and the calendar :

       

      ... Date... , Mindate, MaxDate.... then

      Y AS Year,

      M AS Month,

      MY AS MonthYear,

      num(MY) AS NumericMonthYear,

      'Q' & ceil(M / 3) AS Quarter,

      D as ...

       

       

      Then afterwards you have all these CM, LY, YTD ... flags :

       

      ...

      //Month flags

      inmonth(D, $(vToday), 0) * -1 AS CM,  //Current month

      inmonth(D, $(vToday), -1) * -1 AS PM,  //Previous month

      ...

       

      This all works, but how do I use these flags now in my expression?

      Let's say I have a field "Quantity", and I would like to see the tonnes for CM and PM in a table, how do I do this?

       

      sum(if(CM=1,Quantity)) or something? I really don't know...

       

      Thanks!!