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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ordering a calculated Dimension

Hi

I have created a chart with a grouped calculated dimension

which is 0 1-10 11-20 21-30 31-40 41-50 51-56 57-70 70-90 91-120 121+

however the dimension on the graph is showing as 0 1-10 11-20 121+ 21-30 31-40 41-50 51-56 57-70 70-90 91-120

any ideas on how to solve this problem so that it is in the correct order of 0 1-10 11-20 21-30 31-40 41-50 51-56 57-70 70-90 91-120 121+ ?

Thanks

Laura

1 Solution

Accepted Solutions
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

When deriving your calculated dimension, use Dual instead of just text - that way you can manage the sort order numerically (truncated example):

=If(Dim1 = 0, Dual('0',0),

if(Dim1 <= 10, Dual('1-10', 10),

if(Dim1 <=20, Dual('11-20', 20),

if(Dim1 <= 120, Dual('21-120', 120),

Dual('121+',121)))))

Stephen

View solution in original post

1 Reply
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

When deriving your calculated dimension, use Dual instead of just text - that way you can manage the sort order numerically (truncated example):

=If(Dim1 = 0, Dual('0',0),

if(Dim1 <= 10, Dual('1-10', 10),

if(Dim1 <=20, Dual('11-20', 20),

if(Dim1 <= 120, Dual('21-120', 120),

Dual('121+',121)))))

Stephen