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: 
nihhalmca
Specialist II
Specialist II

Sorting Issue

Hi All,

I have filed Month has Jan, Feb, Mar.....Dec

Suppose if i select FEB selected value should be appeared last in filed(if gives sort order is Ascending) else first in field (if gives sort order is Descending).

My requirement is not change the place of value in filed. ex: if i select FEB it should appear 2nd place in field.

I hope you people understand my requirement.

Thanks you,

Regards,

Nihhal.

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi Use the following expression in

sort tab select dimension and select the expression in that expression write the code like this

=If(Monthname='Jan',1,If(Monthname='FEB',2,If(Monthname='MAR',3,If(Monthname='APR',4,If(Monthname='MAY',5,If(Monthname='JUN',6,If(Monthname='JUL',7,If(Monthname='AUG',8,If(Monthname='SEP',9,If(Monthname='OCT',10,If(Monthname='NOV',11,If(Monthname='DEC',12)))))))))))))))))

View solution in original post

15 Replies
preminqlik
Specialist II
Specialist II

go to list box properties >> sort tab>>

sort by expression >>=only(num(Month(Date#(Monthfieldname,'MMM'))))

nihhalmca
Specialist II
Specialist II
Author

Hi Prem Kumar,

Not working. it gives the same result.

Anonymous
Not applicable

hi follow this,

In the properties > Sort tab > Select Dimension >Please check on the right side expression and enter like

= u r monthfiled

hope it will helps..

nihhalmca
Specialist II
Specialist II
Author

Hi Sreekanth,

Not working.

Anonymous
Not applicable

Hi Use the following expression in

sort tab select dimension and select the expression in that expression write the code like this

=If(Monthname='Jan',1,If(Monthname='FEB',2,If(Monthname='MAR',3,If(Monthname='APR',4,If(Monthname='MAY',5,If(Monthname='JUN',6,If(Monthname='JUL',7,If(Monthname='AUG',8,If(Monthname='SEP',9,If(Monthname='OCT',10,If(Monthname='NOV',11,If(Monthname='DEC',12)))))))))))))))))

alkesh_sharma
Creator III
Creator III

Use dual while creating the months, the best way to overcome sorting issues. or sort-> state-> auto ac ascending might work.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Properties -> Sort -> Select Field -> Uncheck State option.

Regards,

Jagan.

nihhalmca
Specialist II
Specialist II
Author

Hi jagan, thanks for your response.

Not working. anyways i got solution by sreekanth.

Regards,

Nihhal.

isorinrusu
Partner - Creator III
Partner - Creator III

Nihhal, although that solution works, it's not the best by far. You'd better look for a more performant solution.

For example, try to associate a number to each month. Then sort it as you would normally do.