Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

chart x- axis sorting

Hi All,

I'm having a chart in attached qlikview file. I want to sort x-axis values as follows

OOC,

1 month,

2 to 3 months

4 to 6 months

>12 months.

I think I have to write some condition under sort tab but I'm not getting which condition to write there.

I tried with sum(bucket), count(bucket). But they are not giving required result. So please help me sort x-axis in the way I have explained above.

Thanks a lot!!!

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I used the dual function in your calculated dimension to get the solution.

See attached example.

View solution in original post

16 Replies
Not applicable
Author

Hi

use match function as an expression in the sort tab of the chart properties

match(Month, '4 to 6 months','2 to 3 months','1 to 2 months','1 Month')

Thanks and Regards

Padma

Not applicable
Author

Hi Padma,

Thanks for the reply.

What is Month in above expression??

In my case I'm having "bucket" column using which following text values are assigned. And then that is used as dimension in chart.

OOC,

1 month,

2 to 3 months

4 to 6 months

>12 months.

alexandros17
Partner - Champion III
Partner - Champion III

Go in sort tab and take a look

Not applicable
Author

In this case 'month' is not a dimension.  The buckets are calculated dimensions that the OP created

Not applicable
Author

Hi

OOC,

1 month,

2 to 3 months

4 to 6 months

>12 months.

Not applicable
Author

Hi,

I used the dual function in your calculated dimension to get the solution.

See attached example.

Not applicable
Author

I feel instead of creating calculated dimension it's better to create an another field in the script itself. So that you can create an order by defining the order in another flag filed or you can use load order to sort.

Not applicable
Author

Hi Kavita

Month is whatever dimension or expression you would like to sort

Thanks and regards

Padma

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

See attached. Used duals in the calculated dimension

=

if(BUCKET<0, Dual('OOC', 0),

if(BUCKET=1, Dual('1 month', 1),

if(BUCKET=2 or BUCKET=3, Dual('2 to 3 months', 2),

if(BUCKET=4 or BUCKET=5 or BUCKET=6, Dual('4 to 6 months', 4),

if(BUCKET=7 or BUCKET=8 or BUCKET=9 or BUCKET=10 or BUCKET=11 or BUCKET=12, Dual('7 to 12 months', 7),

Dual('>12 months', 12)

)))))

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein