Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi my Last month set expression is not working in Qlik sense.
I have Date fields in source file .from that i got month.
i have to show This month value and last month value in pivot table.
sum({<MonthP={$(=Max(MonthP)-1)},DateP=>}MonthlyActual)
Plz help me.it is urgent.
Thanks
sum({<MonthP={$(=Date(Date#(Month(Date#(MaxString(MonthP),'MMM'))-1,'M'),'MMM'))},DateP=>}MonthlyActual)
Hi,
Some of your load statements have 'DD/MM/YYYY' and some are with ' M/D/YYYY'
please check has this effecting your date format ?
sum({<MonthP={'Nov'}>}MonthlyActual)
the above expression giving me result for last month when Dec month selected
but
sum({<MonthP={$(=Max(MonthP)-1)},DateP=>}MonthlyActual) giving 0
sum({<MonthP={$(=Date(Date#(Month(Date#(MaxString(MonthP),'MMM'))-1,'M'),'MMM'))},DateP=>}MonthlyActual)
Thanks Sasidhar
Better u can generate monthID,
LET vDateMin='Your Date'
Num(Month($(vDateMin) + IterNo() - 1), '00') | as [Month (#)] |
AutoNumber(Year & [Month (#)], 'MonthID') | as MonthID |
Then use this,
monthid={$(=max(monthid)-1)}