Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pawwy1415
Creator III
Creator III

Sorting expression

Hi,

I have below expression used in dimension and I want to do sorting

= pick(match(MetricID,27,31,394,398,222,224,360,364,368,372,1141,1143,154,156,160,162,213,215,380,382)

     ,'PBT','Provisions','PBT','Provisions','Income','Income','Costs','Costs','Costs','Costs','PAT','PAT',

     'Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs')

sorting should be like

Income

Costs

Provisions

PBT

PAT

RWA

I used below expression in sorting..

= pick(match(MetricID,222,224,360,364,368,372,31,398,27,394,1141,1143,154,156,160,162,213,215,380,382)

     ,1,1,2,2,2,2,3,3,4,4,5,5,

     6,6,6,6,6,6,6,6)

but it doesn't work.. it's come in below order

Total RWAs

Costs

income

Provisions

PBT

PAT

Could you please see if I am doing something wrong in sorting?

23 Replies
sunny_talwar

Create this as an expression and share an image of your whatever you have as dimension and this expression

pawwy1415
Creator III
Creator III
Author

this is used as expression >> it's calculated dimensions

= pick(match(MetricID,27,31,394,398,222,224,360,364,368,372,1141,1143,154,156,160,162,213,215,380,382)

     ,'PBT','Provisions','PBT','Provisions','Income','Income','Costs','Costs','Costs','Costs','PAT','PAT',

     'Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs','Total RWAs')

all others are measure

sunny_talwar

That is fine... use that as your dimension and this as your expression and post a screenshot... I don't need to see any other measure

=Match(

Pick(

Match(Only({1} MetricID),27,31,394,398,222,224,360,364,368,372,1141,1143,154,156,160,162,213,215,380,382),

'PBT', 'Provisions', 'PBT', 'Provisions', 'Income', 'Income', 'Costs', 'Costs', 'Costs', 'Costs', 'PAT', 'PAT', 'Total RWAs', 'Total RWAs', 'Total RWAs', 'Total RWAs', 'Total RWAs', 'Total RWAs', 'Total RWAs', 'Total RWAs'),

'Total RWAs', 'Costs', 'Income', 'Provisions', 'PBT', 'PAT')

pradosh_thakur
Master II
Master II

hi

please refer a sample which i have attached here for similar problem.

i have used dual function. hopefully it will help.

regards

Pradosh

Learning never stops.
pawwy1415
Creator III
Creator III
Author

there is no sample attached..

pawwy1415
Creator III
Creator III
Author

I can't use this as Dimension it's showing invalid dimesions..I was adding in sorting'expression;

pawwy1415
Creator III
Creator III
Author

Capture.PNG

sunny_talwar

I asked you to continue using your current dimension my friend... I just want you to add my expression as a measure... does it make sense now?

pradosh_thakur
Master II
Master II

i have attached the sample. if you look through inbox you wont see it .

Try this then

dimesnsion

= pick(match(MetricID,27,31,394,398,222,224,360,364,368,372,1141,1143,154,156,160,162,213,215,380,382),dual('PBT',5),dual('Provisions',4),dual('PBT',5),dual('Provisions',4),dual('Income',3),dual('Income',3),dual('Costs',2),dual('Costs',2),dual('Costs',2),dual('Costs',2),dual('PAT',6),dual('PAT',6),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1))


sorting expression


num(pick(match(MetricID,27,31,394,398,222,224,360,364,368,372,1141,1143,154,156,160,162,213,215,380,382),dual('PBT',5),dual('Provisions',4),dual('PBT',5),dual('Provisions',4),dual('Income',3),dual('Income',3),dual('Costs',2),dual('Costs',2),dual('Costs',2),dual('Costs',2),dual('PAT',6),dual('PAT',6),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1),dual('Total RWAs',1)))



regards

Pradosh

Learning never stops.
pawwy1415
Creator III
Creator III
Author

Capture.PNG

it's showing order as per attached screenshot..

but we need below sorting order

Income

Costs

Provisions

PBT

PAT

RWA