Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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.