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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ordering a dimension

Hi

I have created a chart with a grouped 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

7 Replies
avastani
Partner - Creator III
Partner - Creator III

Create a second field in that INLINE table called DimensionSortOrder

LOAD * INLINE[

     Dimension, DimensionSortOrder

     a, 1

     b, 2

];

in the chart, do an expression sort on the dimension using the DimensionSortOrder.

Not applicable
Author

i tried this but it didnt work, as the dimension is a calculated dimension

jagan
Partner - Champion III
Partner - Champion III

Hi,

If this values "0 1-10 11-20 21-30 31-40 41-50 51-56 57-70 70-90 91-120 121+" are static create an inline table like

Interval     Order

0 1-10          1

11-20           2

'

'

'

'

'

'

'

Now in sort tab use the Load order.

Regards,

Jagan.

avastani
Partner - Creator III
Partner - Creator III

Calculated Dimension is never a good idea unless absolutely required to. Can you not use an INLINE table and build the Dimension? Calc Dims are the hardest on performance and drag the app down.

Not applicable
Author

i need to use a calculated dimension and it hasnt brought the performance time down.

Is there no way of doing this with a calculated dimension?

avastani
Partner - Creator III
Partner - Creator III

There probably is and I recall having done one long long time ago.

Somehow you need to assign it a numeric value at the same time that it is a text value i.e. like the DUAL() function.

DUAL is used in script but I can't remember what I did to solve this riddle. are you in v11? if so, try adding a dummy dimension that is hidden and sort the table on that hidden dimension.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Can you attach sample file.

Regards,

Jagan.