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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting y axis in graph

I have ranges as shown in the attachment.Range.JPG

I want to sort it in y axis as :-

More than 1000k

500 to 1000k

200k to 500k

100k to 200k

Less than 100k

0

Note :- Without any hard coding.

16 Replies
Not applicable
Author

yep, you are ryt 🙂 , This is a field directly from datasource, ranges are its values

say 'X' field from Datasource and its values are these ranges.

Not applicable
Author

Hi Try like this

   Put load order based on y axis that you using as a dimension

sunny_talwar

I suggest using Dual function in your script to create numeric values for your fields. For the sample provided, this script should work fine:

Table:

LOAD Field,

  Dual(Field, Alt((Num#(KeepChar(SubField(Field, ' ', 1), '0123456789'), '##') + Num#(KeepChar(SubField(Field, ' ', -1), '0123456789'), '##'))/2,

  KeepChar(Field, '0123456789'))) as NewField;

LOAD * Inline [

Field

More than 1000k

500 to 1000k

200k to 500k

100k to 200k

Less than 100k

];

Where NewField looks like your ranges, but they also have associated value with them which can then be sorted in ascending or descending values

Capture.PNG

sunny_talwar

Chart would look like this:

Capture.PNG

Not applicable
Author

Yeah its working,

Thank you Sunny 🙂

sunny_talwar

Awesome

I am glad it is working the way you wanted

Best,

Sunny

Not applicable
Author

Yeah, its working as I expected.

Thanks much Sunny