Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello and a Happy New Year to everyone! 🙂
We have an expression set up for Last Calendar Month (LCM) already, although it doesn't seem to be working correctly since we have now moved into the New Year. We would expect the results to show December although it is just showing January's current sales. See below for the LCM script;
IF( (Month([Date]) = Month (Today()-1)-1), 'Y', Null())
AS IsLCM,
Any and all help would appreciated!
Use AddMonths() rather than month subtraction, since January = 1 and subtracting 1 from 1 results in 0, not 12.
Hi Or,
Thank you for your help. That makes sense, although I'm not sure how to implement this? What I have tried comes up as an error.
Perhaps something along the lines of:
If(MonthName(Date) = MonthName(AddMonths(Today()-1,-1),'Y')
if(monthstart([Date])=monthstart(Today()) and [Date] >=Today(),1,0 ) as Flag_MTD
Use this flag in set analysis