Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sort

Hi guys,

I want to make custom sort.

My dimension is

=if(='Shop specific','Shop',if(='Browse','Shop',if(='Learn pricing','Shop',

if(='Check order','Everything else',if(='Manage account','Everything else',if(='Support','Everything else',

if(='Make purchase','Make a purchase')))))))

I want Make a purchase  --1

          Shop                   --2

          Everything else    ---3

How to do it easy?  in Load script use rank or use expression in sort?

Thanks,

1 Solution
7 Replies
rustyfishbones
Master II
Master II

try adding the expression in the sort by Expression

2013-10-15_2226_001.png

Anonymous
Not applicable
Author

Hi Alan,

I do usually, but now I coded each tag to custom. It doesn't work.

rustyfishbones
Master II
Master II

Have you tried Match

MATCH(Fieldname,'Value1','Value2','Value3','Value4')

Anonymous
Not applicable
Author

I tried

if(WildMatch(,'Shop specific*'),2,

if(WildMatch(,'Browse*'),3,

if(WildMatch(,'Learn pricing*'),4,

if(WildMatch(,'Check order*'),5,

if(WildMatch(,'Manage account*'),6,

if(WildMatch(,'Support*'),7,

if(WildMatch(,'Make purchase*'),1)))))))

pgrenier
Partner - Creator III
Partner - Creator III

Hello Vladimir,

One trick you might want to try out is using a LOAD * Inline statement to predefine the order in which the field values should always be presented, especially if these values are static.

Hence, prior to loading your data from the external source, add this part to your script:

tmp_A:

LOAD * Inline [

A

Make purchase

Shop specific

Browse

Learn pricing

Check order

Manage account

Support];

The naming of the "A" field is important, it should be the same as the way you refer to it once your loading process is done.

At the end of your script the tmp_A table is no longer necessary, the order has been established. You may drop the tmp_A table as such:

DROP Table tmp_A;

Once this is achieved, you can now start to use a fancy ordering method called "Load Order: Original", as illustrated below:

LoadOrder.jpg

Once that option is selected, your dimension values shall be presented in the order they were first read into memory. Furthermore, using this option on dimensions with a lot a values is very fast!

Regards,

Philippe

Not applicable
Author

Hi. try use like this

MATCH(,'Make purchase*','Shop specific*','Browse*','Learn pricing*','Check order*','Manage account*','Support*')

regards

Gernan