Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
CSmith
Contributor III
Contributor III

Not sorting months correctly

I am using this expression, Coalesce(sale_month_n,max({<sale_year = {"$(=Max(sale_year)-1)"} >} sale_month_n)). It works to sort the months correctly if I select the current year. Any other year selected the months are not being sorted correctly.

Labels (3)
2 Solutions

Accepted Solutions
Chanty4u
MVP
MVP

Try this 

Max({<sale_year = {"$(=Max(sale_year))"} >} sale_month_n)

In sorting tab enable numeric sorting and use below expression 

Dual(sale_month_n, Month(Date#(sale_month_n, 'MMM')))

 

View solution in original post

CSmith
Contributor III
Contributor III
Author

Thank you!! I figured it out already. But when I used your expression it also works. 

View solution in original post

2 Replies
Chanty4u
MVP
MVP

Try this 

Max({<sale_year = {"$(=Max(sale_year))"} >} sale_month_n)

In sorting tab enable numeric sorting and use below expression 

Dual(sale_month_n, Month(Date#(sale_month_n, 'MMM')))

 

CSmith
Contributor III
Contributor III
Author

Thank you!! I figured it out already. But when I used your expression it also works.