Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts ,
Greetings!
I have below sample data
Year Month | Sales |
2020/2 | 30 |
2020/5 | 50 |
2020/6 | 70 |
2020/8 | 90 |
Requirement: need to compare max month data(2020/8) and previous month data(2020/6) as dimensions .
i used below expression for
max month: max(YearMonth) showing 2020/8 (showing as expected)
previous month/record: =date(max([YearMonth])-1,'YYYY/MM')
=date($<YearMonth = {$(=Max(YearMonth) – 2)}>},YYYY/MM)
=Previous(max(YearMonth))
Please help to how i can show max month(2020/8) and previous record(2020/6) of max month
Note: Year Month column not followed any series , if any sales are happen that month data comes into DB.
one of qlik's magic tricks :
Max(X) for max X, Max(X,2) for the second max of X
so you need :
MAX :
=Date(Max(Date#([Year Month],'YYYY/M')),'YYYY/M')
PREVIOUS:
=Date(Max(Date#([Year Month],'YYYY/M'),2),'YYYY/M')
output :
one of qlik's magic tricks :
Max(X) for max X, Max(X,2) for the second max of X
so you need :
MAX :
=Date(Max(Date#([Year Month],'YYYY/M')),'YYYY/M')
PREVIOUS:
=Date(Max(Date#([Year Month],'YYYY/M'),2),'YYYY/M')
output :