Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sorting Month-Year by Month Name

In my chart, the data is all correct but my dimension is not sorting correctly.

=if(date(renewal_dt) <= date(GetFieldSelections(prod_dt))+182.5 and month(renewal_dt) <> month(GetFieldSelections(prod_dt)), month(renewal_dt) &' '& year(renewal_dt),

if(renewal_dt > GetFieldSelections(prod_dt), year(renewal_dt),))

This is the dimension. It displays the next six months and then after that, just the years, based on whatever production date is chosen. Attached is a snapshot of how the dimension is displayed when I sort just numerically and have 10/31/15 selected as the production date.

The years are in the correct order but the Months are not and that is what I am struggling with

12 Replies
Anonymous
Not applicable
Author

Use Max({1} Month(

if(date(renewal_dt) <= date(GetFieldSelections(prod_dt))+182.5 and month(renewal_dt) <> month(GetFieldSelections(prod_dt)), month(renewal_dt) &' '& year(renewal_dt),

if(renewal_dt > GetFieldSelections(prod_dt), year(renewal_dt),))

) on Sort Expression.

Kind regards

Anonymous
Not applicable
Author

I just noticed I still had an expression in the sort and had the box checked, this did work! Thank you so much

sunny_talwar

See a more detailed description did help us, right? I am glad we were finally able to resolve this.

Best,

Sunny