Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

PIVOT chart us not able sort

Age Slot# of Incidents
< 5 Days65
5 to 10 Days55
11 to 30 Days124
> 30 Days509
Total753

Hi I have this PIVOT chart object. I am able to sort it perfectly like shown above. The AGE SLOT column is in order.

But when I do some selections - Like if I am selecting some team name then this order is getting changed as shown below.

Any specific reasons?

Age Slot# of Incidents
11 to 30 Days4
> 30 Days5
< 5 Days5
5 to 10 Days6
Total20
1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

Load *,

If(Days < 5, Dual('<5 Days', 1),

If(Days <= 10, Dual('5 to 10 Days', 2),

if(Days <= 30, Dual('11 to 30 Days', 3), Dual('>30 Days', 4))) as "Age Slot"

from datasource;

Then

In Pivot table -> Sort , use Num([Age Slot]) in Expression  and Ascending.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

5 Replies
marcus_sommer

Have you tried it with a dual-field from [Age Slot]?

dual(string-value, numeric-value)

- Marcus

Not applicable
Author

Hi Vijay,

go to Sort -> check Expression ->  type

sum({1} Age)

Hope this might help

Anonymous
Not applicable
Author

Hi,

Check in Sort tab, might be you have opted ascending in Numeric value.

Anonymous
Not applicable
Author

Hi Marcus,

What is dual(string-value, numeric-value) and where I have to use it?

MayilVahanan

Hi

Try like this

Load *,

If(Days < 5, Dual('<5 Days', 1),

If(Days <= 10, Dual('5 to 10 Days', 2),

if(Days <= 30, Dual('11 to 30 Days', 3), Dual('>30 Days', 4))) as "Age Slot"

from datasource;

Then

In Pivot table -> Sort , use Num([Age Slot]) in Expression  and Ascending.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.