Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Rank function for non-numeric values

Hello,

I have a Segment field with values 'H', 'M', 'L'

To sort these, I am not able to use load order, alphabetical, etc. Without adding an INLINE table to the script, is it possible to use tha Rank function to order my segments like H, M, L in my table?

Many thanks

Mel

Tags (1)
1 Solution

Accepted Solutions

Re: Rank function for non-numeric values

You can use an expression to sort the chart. On the Sort tab choose the option Sort By Expression and use this expression: =match(only({1}Segment), 'H','M','L')


talk is cheap, supply exceeds demand
5 Replies

Re: Rank function for non-numeric values

Use as below..

Load

  Dual(Field,Ord(Field)) as Field

Inline

[

  Field

  H

  M

  N

  X

  Z

];

Now you can sort by ascending or descending order.

Not applicable

Re: Rank function for non-numeric values

Hi Manish,

Thank you very much for this. I'm not able to touch the load script, however. Is it possible to accomplish similar from a calculated dimension or from Sort at a chart level?

Thanks

Mel

Not applicable

Re: Rank function for non-numeric values

Hi mvankluyve,

you won't be able to use rank like this, you could potentially load your field as a dual() so that each value does have an underlying numerical value for you to sort using.

The other option you have is to sort via an expression and define the order within this.

Hope that helps

Joe

Re: Rank function for non-numeric values

You can use an expression to sort the chart. On the Sort tab choose the option Sort By Expression and use this expression: =match(only({1}Segment), 'H','M','L')


talk is cheap, supply exceeds demand
Not applicable

Re: Rank function for non-numeric values

Brilliant - thanks so much, Gysbert!

Community Browser