Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working on table. I have table Like -
Applicable | Reported | Result |
---|---|---|
Y | Y | Yes |
Y | N | Not Applicable |
N | N | NA |
I have done this issues using the "Nested If" condition.
like -
If(Applicable='Y' and Reported='Y', 'Yes'
,if(Applicable='Y' and Reported='N', 'Not Applicable'
,If(Applicable='N' and Applicable='N', 'NA'))) as "Result"
but I want to do this using the "Pick and Match function" because there is two condition (Applicable and Reported). how it possible.
Please help.
i dont understand your Problem
result not in " " Setting and you become this table !
myIF:
load * Inline [
Applicable, Reported, ResultSoll
Y, Y, Yes
Y ,N, Not Applicable
N, N, NA
];
EndeFile:
load *,
If(Applicable='Y' and Reported='Y', 'Yes'
,if(Applicable='Y' and Reported='N', 'Not Applicable'
,If(Applicable='N' and Applicable='N', 'NA'))) as Result
resident myIF;
drop Table myIF;
Hi Gerold Roser
my question is
Result = "Yes", if Applicable = "Y" and Reported = "Y"
Result = "Not Applicable" , If Applicable ="Y" and Reported = "N"
Result = "NA" , If Applicable = "N" and Reported = "N".
I have done this issues with Nested If Condition. but I want to do this issues with "Pick and Match" function.
Re: Multiple IF, PICK AND MATCH
see here 🙂
Hi Sushant,
If these are the only possible states, then try this expression:
=pick(match('N',Applicable,Reported)+1,'Yes','NA','Not Applicable')
It assumes when Applicable='N' then the Reported field is also 'N'
G.
and don't manage that situation, when one of the fields is null
Hi,
another solution might be:
table1:
LOAD Applicable,
Reported,
Pick(Match(Applicable&'/'&Reported,
'N/N' , 'N/Y' , 'Y/N' , 'Y/Y'),
'NA' , 'undefined' , 'Not Applicable' , 'Yes'
) as Result
FROM [https://community.qlik.com/thread/309934] (html, codepage is 1252, embedded labels, table is @1);
hope this helps
regards
Marco