Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting a calculated dimension

Hello everyone,

I have a bar graph with a calculated dimension like this:

= if (budget <= 100, 'bis ' & 100, 

     if(budget > 100 and budget <= 200, 'bis ' & 200,

     ...

)

'bis' is the german word for 'up to'. The result is a diagram like this:

sorting_question.PNG

As you see, the calculated dimension (x-axis) is not in the correct order. Correct would be:

bis 100

bis 200

bis 300

bis 400

...

bis 1000

...

I can not sort by number or by alphabetical order, the results are always wrong. But how can I sort such a dimension with an expression?

1 Solution

Accepted Solutions
ramoncova06
Specialist III
Specialist III

use dual

= if (budget <= 100, dual('bis & 100', 1),

     if(budget > 100 and budget <= 200, dual('bis 200',2),

     ...

)

and then sort them by numeric value

View solution in original post

4 Replies
ramoncova06
Specialist III
Specialist III

use dual

= if (budget <= 100, dual('bis & 100', 1),

     if(budget > 100 and budget <= 200, dual('bis 200',2),

     ...

)

and then sort them by numeric value

Not applicable
Author

It worked. Thank you very much.

Anonymous
Not applicable
Author

Thank you so much!

madushanfernand
Contributor III
Contributor III

Thank a lot Ramon, i was trying for this many times, you saved my time.