Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
We required an variable which would be Monthstart to till date.
Thanks..
May be like:
vMTD = Sum({<Date={'>=$(=MonthStart(Max(Date))) <=$(=Date(Max(Date)))'}>}Sales)
You can try this if you want to use it in set analysis.
set vVariable = '>=$(=date(max(MonthStart))) <=$(=date(today()))';
and use this variable in set analysis.
sum({<Date = {"$(vVariable)"}>}Field)
I hope it is helpful.
If you use this in expression :
Set Variable :
variable1 = MonthStart(variable2 )
variable2 = date(Max([Date]),'DD/MM/YYYY')
Expression :
Sum({<DATE={'>=$(variable1 )<=$(variable2)'}>} [MeasureName])
You can take VMTD= date(today(),'YYYY-MM').
Thanks,
Hi,
Sorry i need variable starts from September to till date.
Thanks..
will it always be September or Previous Month Start?
You can change your variable1 as required.
I think you can use tresesco answer, with some small changes
Sum({<Date={'>=$(=MonthStart(makedate(2016,9))) <=$(=Date(today()))'}>} Sales)
or this
Sum({<Date={'>=$(=MonthStart(addmonths(today(),-1))) <=$(=Date(today()))'}>} Sales)