Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sorting month field

Hi all

Please let me know how can I sort field named 'Month' having values as follows:

Month
Feb
Aug
Jan
May
Nov
July

I want to display values 'Month' field as:

  

Month
Jan
Feb
May
July
Aug
Nov

Thanks in advance.

Regards,

12 Replies
Chanty4u
MVP
MVP

where you want this?  front end  listbox ? bar chart? 

Chanty4u
MVP
MVP

try to do like this

Try this Expression:

wildmatch(only({1}Month_field),'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')

ahmar811
Creator III
Creator III

Hi,

If you try to sort Month in some chart you just put sorting condition into Chart Properties->Sorting->Expression

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

or

If you want to sort from load script implement below condition

dual(wildmatch(Month,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov,'Dec'),Moth) as Month

and sort by Month should be used

and above expression should be in Ascending order;

Regards

Ahmar

Anonymous
Not applicable
Author

Thanks for reply.

I want to do this in a table box. there I have several fields, one is 'Month' field.

Anonymous
Not applicable
Author

Thanks for replying.

Do I need to include all 12 months in the expression or just above listed months, in ascending order.

shiveshsingh
Master
Master

Can't you simply sort the table box based on month?

keerthika
Creator II
Creator II

Hi,

If you want to sort month in list box ,create list box with field select Month and in sort tab enable Expression and use

=only({1}Num(month(date#(Month,'MMM'))))

and select Ascending in expression dropdown.

Regards,

keerthika

Anonymous
Not applicable
Author

That's what my question is. if I try Tablebox properties---> Sort tab----Select Month field then what are the option to sort month field.

I am sure we cant do it by setting Text/Number in ascending and descending order. Because this does not apply to Month field values.

shiveshsingh
Master
Master

ok, choose expression wise sort and put =only({1}month(date#(Month,'MMM')))