Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sort the dimension

I want to sort  the dimension in ascending order.

The values of dimension are  (varchar type) : 0,1,2,3~19,20+

I've try to write expression to sort these values.But it didn't work.

Anyone can help?

Thank you

Labels (1)
1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

HI,

Do the following

Select Chart Properties -> Sort -> Select Sort by -> Expression

=Match(DimensionName, '0', '1', '2', '3~19', '20+')

Hope this helps you.

Regards,

jagan.

View solution in original post

6 Replies
Not applicable
Author

IF(yourfield < 3, yourfield, IF(yourfield = '3~19', 3, 4))

Put the calculation in sort by Expression under the Sort-tab

jagan
Partner - Champion III
Partner - Champion III

Hi,

Hope attached file helps you.

Select Chart Properties -> Sort -> Select Sort by -> Text and uncheck others.

Regards,

Jagan.

Not applicable
Author

The 3~19 ia an interval, so the result shoud be:

0

1

2

3~19

20+

Numerical sorting doesn't work here, need to be an expression.

jagan
Partner - Champion III
Partner - Champion III

HI,

Do the following

Select Chart Properties -> Sort -> Select Sort by -> Expression

=Match(DimensionName, '0', '1', '2', '3~19', '20+')

Hope this helps you.

Regards,

jagan.

Not applicable
Author

Or just do as i wrote in the first response: IF(yourfield < 3, yourfield, IF(yourfield = ',3~19', 3, 4))

Not applicable
Author

no it's not working.

The result is  0 ,20+, 1 ,2, 3~19

An match methos is ok.

And Inspired by you ,my solution is if(Logins = '20+',4,if(Logins = '3~19',3,Logins))

Thank you all!