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

Sorting

mnvrma_0-1614770641985.png

I'm showing the last 12 months' data and I'm using wildmatch statement with the Month field in the sorting.

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

I have to change this statement for the upcoming month.

is it possible to do sorting in other method or with any new field?

3 Replies
Chanty4u
MVP
MVP

it will come automatically right?

In the sort tab mark the expression and write the expression as given below :

if(wildmatch(Month,'Mar'),1,if(wildmatch(Month,'Apr',2,if(wildmatch(Month,'May'),3,if(wildmatch(Month,'Jun'),4)))))

 

or

You can try a sort expression like

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

like that do for all. and change accordingly

Or
MVP
MVP

Wouldn't it make more sense to use the full month (e.g. Mar 21, Feb 22)? That would auto-sort correctly, instead of trying to force-sort the month names. You can still elect to only display the month name by formatting it as 'mmm', but you'd be using MonthName(Date) instead of Month(Date) to get your field.

raghuchowdary
Contributor II
Contributor II

Hi,

did you try just giving  your 'Date' field in the sorting expression.