Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

Custom sort in a report

Hi All,

How to do custom sort in a report?

 

%No Of Emps
>30%12
10%-20%45
20%-30%60
0%-10%14


Thanks in advance

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are using this in multiple charts, then in every chart you need to hard code this expression, instead of this try like this

SomeTableName:

LOAD

*

INLINE [

%

>30%

10%-20%

20%-30%

0%-10% ];

Note : The script should be kept at the beginning of the script.

Now in chart properties -> Sort-> Select Dimension -> Select Load Order -> Original

Hope this helps you.

Regards,

Jagan.

View solution in original post

10 Replies
sunny_talwar

I am guessing that the % field is a calculated dimension. You should be able to sort it using a sort expression like this:

Match(YourCalculatedDimension, '>30%', '10%-20%', '20%-30%', '0%-10%')

You will just need to make sure that values within the single quotes ('>30%') match exactly, even the spaces, with how your dimension outputs.

Best,

Sunny

qlikviewwizard
Master II
Master II
Author

Hi sunindia ,

Thank you.

sunny_talwar

I was working on a sample for you. I guess its no more needed, but I am still going to attach since I have already worked on it

Best,

Sunny

qlikviewwizard
Master II
Master II
Author

Hi sunindia ,

Thank you for your attached file. Actually I have done everything on script level but you have shown me front end.Now it is perfect.

Many thanks dude.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are using this in multiple charts, then in every chart you need to hard code this expression, instead of this try like this

SomeTableName:

LOAD

*

INLINE [

%

>30%

10%-20%

20%-30%

0%-10% ];

Note : The script should be kept at the beginning of the script.

Now in chart properties -> Sort-> Select Dimension -> Select Load Order -> Original

Hope this helps you.

Regards,

Jagan.

qlikviewwizard
Master II
Master II
Author

Hi jagan

Thank you .

sunny_talwar

jagan‌I agree with you that doing it in the script would be quite useful, but I don't think that you will necessarily have to retype the same expression over and over again for different charts, you can always create a variable and use that over and over again.

vSort = Match(YourCalculatedDimension, '>30%', '10%-20%', '20%-30%', '0%-10%')

Best,

Sunny

jagan
Luminary Alumni
Luminary Alumni

Hi,

When chart loading with Load Order then the performance would be better when compared to the expression.  Your expression in variable also works but this is the best solution.

Regards,

Jagan.

sunny_talwar

This seems like a valid argument. I think I will have to test this out because I didn't think that load order would be faster than expression, but it does make sense.

Thanks jagan mohan

Best,

Sunny