This content has been marked as final. Show 2 replies
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 :
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...