Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm using the below logic to get rolling 12 months of data based on max datre selection.
But when I select a month the bar chart is shoing data for only one month insead of rolling 12 months.
Please check once.
if(Attributes='TOTAL EVENTS',
Count({<Month=, Year=,
[Postng Date]={">=$(=MonthStart(AddMonths(Max([Postng Date]),-12)))<$(=MonthEnd(Max([Postng Date])))"}>}distinct [Commercial DEFOA: ID]),
if(Attributes='SUPPLY CHAIN SECURITY ISSUE',
Count({<[Supply Chain Security Issue]={'Yes'}, Month=, Year=,
[Postng Date]={">=$(=MonthStart(AddMonths(Max([Postng Date]),-12)))<$(=MonthEnd(Max([Postng Date])))"}>} [Supply Chain Security Issue]),
if(Attributes='CORE PSCS', Count({<[Core PSCS]={'Yes'}, Month=, Year=,
[Postng Date]={">=$(=MonthStart(AddMonths(Max([Postng Date]),-12)))<$(=MonthEnd(Max([Postng Date])))"}>} [Core PSCS]),
if(Attributes='NCR', Count({<[NCR #]={'Yes'},Month=, Year=,
[Postng Date]={">=$(=MonthStart(AddMonths(Max([Postng Date]),-12)))<$(=MonthEnd(Max([Postng Date])))"}>} [NCR #])))))
Thanks,
Krish
Hi,
Any suggestions please.
Thanks,
Krish
@krish2459 does it work properly without Month selection? Why have you written If condition here?
@Kushal_Chawda It is working proely with out Month year selection.
I have created four buttons for different attributes.
For that I have used If conditions.So based on selections the chart should work for rolling 12 months.
Thanks,
krish
@krish2459 As you are already given button for attributes. You can add "Select values in a field" actions for field Attribute and Value for eg . '=SUPPLY CHAIN SECURITY ISSUE'
Also, you can create one variable (Let's say vAttributeMeasure) . Add another action on Button as "set variable value" and assign Value for eg. '[Supply Chain Security Issue]'.
Above actions you can add on other buttons. Once this is done you can simply create single measure as follows which will work for all attribute
Count({<[Supply Chain Security Issue]={'Yes'}, Month=, Year=,
[Postng Date]={">=$(=MonthStart(AddMonths(Max([Postng Date]),-12)))<$(=MonthEnd(Max([Postng Date])))"}>} $(vAttributeMeasure))