Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wendytham
Contributor II
Contributor II

Sort months in ascending order when displaying last 24 months data

Hi,

i would like to show last 24 months based on current month.

The below expression works well, but the month order is not sort in ascending order, how to fix this problem?

Please assist. Thank you.

=if(((MakeDate(Year,Month) < MonthStart(Today())) and (MakeDate(Year,Month)

>= AddMonths(MonthStart(Today()),-24))),Month(MakeDate(2000, Month, 1)) & ' ' & Year)

1 Solution

Accepted Solutions
olivierrobin
Specialist III
Specialist III

hello

in your graph, you can sort the dimension based on an expression

you cans use something like Year*100+Month

View solution in original post

3 Replies
olivierrobin
Specialist III
Specialist III

hello

in your graph, you can sort the dimension based on an expression

you cans use something like Year*100+Month

jyothish8807
Master II
Master II

You can try like this as well:

=if(((MakeDate(Year,Month) < MonthStart(Today())) and (MakeDate(Year,Month)

>= AddMonths(MonthStart(Today()),-24))),date(date#(Month(MakeDate(2000, Month, 1)) & ' ' & Year,'MMM YYYY'),'MMM YYYY'))


Then use sort option.


Br,

KC

Best Regards,
KC
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

What about this Sort Properties?

Screenshot_1.jpg