Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anyone help to convert the below expression to set analysis?
and MTD for the selected month r date??
=sum(if(month(today(0))=month(Date),sales))
Within the script
LOAD Date,
MonthName(Date) as MonthYear
Resident.....
Try this for sum of sales for the current month.
=Sum({<MonthYear = {"$(=MonthName(Today(0)))"}>} Sales)
Are you also looking to calculate MTD(Month to date)?
Best,
Sunny
Why do you want to convert it to a set expression?
I do not think your expression is perfect for a set expression. You should add a field in your data model that returns the Month(Date) value. If we assume this field has been added and if called 'MonthDate' a set expression could look something like...
=sum( {<MonthDate={"$(=month(today(0)))"}>} sales )
Try this:
=sum({<Date={"=MonthStart(today(0))=MonthStart(Date)"} sales))