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: 
hrithikroshan
Contributor
Contributor

Pick and Match on multiple columns not working for below code

LOAD
[Risk Impact],
[Risk Likelihood],
pick(Match(
([Risk Impact]= 1 and [Risk Likelihood] =1),
[Risk Impact] = 1 AND [Risk Likelihood] =2),'low','high') as calc
FROM
[D:\Risks.qvd]
(qvd);

 

i am not getting the expected output kindly see the attachment, if risk impact and likelihood is 1 then i should get low and if risk impact is 1 and likelihood is 2 then i should get high but i am getting wrong results kindly suggest what i am doing mistake in this code

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

pick(Match( -1,
([Risk Impact]= 1 and [Risk Likelihood] =1),
[Risk Impact] = 1 AND [Risk Likelihood] =2),'low','high') as calc

View solution in original post

4 Replies
Taoufiq_Zarra

Hi,

'Pick', I don't think it's being used in its role if I understood your need correctly.

try this simple formula in the script:

if(([RISKIMPACT]= 1 and [RISKLiKELIHOUD] =1) or ([RISKIMPACT]= 1 and [RISKLiKELIHOUD] =2),'low','high') as NEW_CALC

 

I think that's the expected result.

 

Capture.PNG

 

Regards,

Taoufiq

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
hrithikroshan
Contributor
Contributor
Author

I am using lot of If conditions in my logic and i need to replace multiple if's with pick and match .

for sample purpose i just mentioned only few if conditions

i need to use pick and match only for this requirement

tresesco
MVP
MVP

Try like:

pick(Match( -1,
([Risk Impact]= 1 and [Risk Likelihood] =1),
[Risk Impact] = 1 AND [Risk Likelihood] =2),'low','high') as calc

hrithikroshan
Contributor
Contributor
Author

Perfect answer thanks for your kind time