Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Punit
Contributor
Contributor

Sort by expression line chart is not working

Hello All,

 

I am trying to show the current year vs last year's performance by month in a line chart.

However, when I select date range from mid 2022(say 1st May 2022) till last month(30th April 2023). It doesn't sort in chronological order, I already tried multiple ways.

Somewhere I read it works when sorted by Year, It did work for me the day I implemented it. But now as I see the chart its again back to same random pattern. Not sure if its an issue on Qlik side?

Please guide.

Labels (1)
6 Replies
BrunPierre
Partner - Master
Partner - Master

Sort expression: =Month(Date#(MonthField,'MMM'))

or

Match(Only({1} MonthField)'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')

Punit
Contributor
Contributor
Author

Still not working for me. Just to clarify date range selected is 1st May 2022 to 30th April 2023. I want the months to appear in sequence May, Jun, Jul, Aug, ..., Jan, Feb, Mar, April

But why would it be Oct, Apr, Jan.. as seen in the attached pic. It seems an issue with Qlik Saas.

BrunPierre
Partner - Master
Partner - Master

I get that you trying to sort considering the current month as the first.

=If(Month(MonthField)-Month(Today())<0, (Month(MonthField)-Month(Today())+12),(Month(MonthField)-Month(Today())))

MayilVahanan

Hi

Try to sort by MonthYear field or Date field.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Punit
Contributor
Contributor
Author

Tried them, still not working.

not sure what wrong I am doing here. 

VishalWaghole
Specialist II
Specialist II

Hi 

 

Using Pick(Match()) try to generate seq. number as per your requirement, please use below script,

VishalWaghole_0-1684055435253.png

 

I have plotted May as 1st and Apr as  1 2 number of month using Pick(Match()) and used same field in sorting option under expression, 

VishalWaghole_1-1684055540913.png

 

I hope it will work for you.

 

Thank You,

Vishal Waghole