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

Sort value in a chart and put "Other" at the end

Hi,

I've a chart with several value in dimension, takes for instance :

DimensionValue
A1
Other1
C1
D1
B1

I would like to sorting values in order to have :

DimensionValue
A1
B1
C1
D1
Other1

Infact, I would like to put "Other" at the end. I can't manage the script, so I have to find a solution into properties of chart.

I can't use the alphabetical order, I believe I have to choose the expression order but I have no idea about which function I can use.

Does anyone has an idea ?

Thanks,

Regards,

Marine Le Trionnaire

1 Solution

Accepted Solutions
patroser
Partner - Creator
Partner - Creator

I guess you neither want to hard code all possible values in your sort expression, nor will "Other" be your last alphabetical value.

Therefore I tried to build a generic expression for sorting:

I tried this one for the following Inline Table:

if(Dim <> 'Other', Ord(Dim), max(TOTAL Ord(Dim) + 1))

where Dim is your actual Field name for the dimension. Just put this expression in the sort expression field and decide wehter to sort it ascending or descending.

!

Table:

LOAD * INLINE [

    Dim, Val

    A, 1

    Other, 1

    Z, 1

    C, 1

    D, 1

    B, 1

];

Patrick

View solution in original post

11 Replies
sasikanth
Master
Master

Try  match function in sort tab-->Expression

Match(Dimension,'A','B','C','D','Other')

patroser
Partner - Creator
Partner - Creator

Is "Other" a real value of this dimension or just the cumulation of all values but the first 4?

robert_mika
Master III
Master III

Try:

WildMatch(Dimension,'A','B','C','D','Other')

Can you share your app if this method do not work?

mato32188
Specialist
Specialist

Hi,

try to

sort your dim asc by expression if(Ord(Dimension)<91, Ord(Dimension), 100).


M

ECG line chart is the most important visualization in your life.
sunilkumarqv
Specialist II
Specialist II

HI,

For best you can recreate your Dimension in script

Try like this

If(Field='A',dual('A',1),

Field='B',dual('B',2),Field='C',dual('C',3),Field='D',dual('D',4),Field='Other',dual('Other',5))

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

No need any expression To ur requirement.Simply Go to properties>>Sort>>Enable Text as A-Z.

This is enough for to solve this

Let me know getting solve or not ?

Regards,

Nagarjuna

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Kindly find below attached file.

patroser
Partner - Creator
Partner - Creator

I guess you neither want to hard code all possible values in your sort expression, nor will "Other" be your last alphabetical value.

Therefore I tried to build a generic expression for sorting:

I tried this one for the following Inline Table:

if(Dim <> 'Other', Ord(Dim), max(TOTAL Ord(Dim) + 1))

where Dim is your actual Field name for the dimension. Just put this expression in the sort expression field and decide wehter to sort it ascending or descending.

!

Table:

LOAD * INLINE [

    Dim, Val

    A, 1

    Other, 1

    Z, 1

    C, 1

    D, 1

    B, 1

];

Patrick

Not applicable
Author

Thanks for your answer.

It seems to be right but I would like to be sure I've really understand how to use this function :

I put it : Match(Dimension,'Other') because the others values could be differents. Sometimes A,B,C, or sometimes M,X... so I can't put A,B,C,D... in this function.

Does this function sorted only values which are mentionned ? For the other values I can add an alphabetical order.

Is it right ?

Thanks,

Marine Le Trionnaire