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

Sort by Expression Changes When Selection is Made

I have a bar chart showing months on the x-axis and numbers of users on the y-axis. 

The chart shows employees in a company based on when they were employed and compares 2 years at a time, month by month.  

The chart can be filtered by the Department selection box in the sheet.

I have tried to sort by Expression (Ascending) using the following:

WildMatch(Month,'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar')

The user wants the chart always to run from April to March (their financial year) and this should not change.  However when departments are selected, the sort order changes.  The order it changes to is different with each selection, there does not appear to be a pattern.

I have attempted adding the fix suggested in https://community.qlik.com/t5/New-to-QlikView/Sorting-changes-when-selection-is-made/m-p/978183#M225... but it only seems to work for keeping the sort order static in a Selection Box.  

Are there any other solutions to this kind of issue that anyone has come across?  

 

 

Many thanks!

Eoin

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Try this sort expression

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

you can also use this

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

View solution in original post

2 Replies
sunny_talwar

Try this sort expression

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

you can also use this

Only({1} WildMatch(Month,'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar'))
eoinboylan
Partner - Contributor III
Partner - Contributor III
Author

That has worked perfectly. 

Thank you Sunny_talwar!