Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have an Entitlement field there i have C,T,W
Now i have When ever i select C it should show 1 then if i select T is should be 0 then if i select warranty it should show 1.
Condition i have written is If(Match(Entitlement, 'Contract ', 'T&M', 'Warranty'), 1, 0) as KPI
But i am getting wrong result for C it is 0 and for T and W it is 1 .
Can you please tell me where i am doing wrong.
Attached qvw for more reference.
Hi,
you can try this:
Pick(Match(Entitlement,'C','T','W'),'1','0','1')
Hi Bharat,
If(Match(Entitlement, 'Contract','Warranty'), 1, 0) as KPI
The match function works like this:
Example | Result |
---|---|
match( M, 'Jan','Feb','Mar') | returns 2 if M = Feb. returns 0 if M = Aprorjan. |
If you want T to be False/0 you should remove it from the match function:
if(Match(Entitlement, 'Contract', 'Warranty'),1,0)
With this it checks if the Entitlement is matched with one of these values. and returns the number of it. If it does this it wil return true and give 1 with the if statement. If not the if gives 0.
Oh and you had a tailing space with the contract string.
Thanks a lot.
Can you please tell me where did i miss with my expression and why it is not working.
Thanks,
Bharat
Sure.
1). While typing you have included a space after "Contract" by mistake.
Match(Entitlement, 'Contract ', 'T&M', 'Warranty')
2) Also your If condition is not correct. Your "If" condition says that If the Entitlement field is match with "Contract" or "T&M" or "Warranty" then KPI should be 0 and for the remaining entitlement it should be 1. That is basically wrong as per your requirement.
The condition should be
If(Match(Entitlement, 'Contract','Warranty'), 1, 0) as KPI (If Entitlement is "Contract" or "Warranty" then KPI should 1 and for the rest it should be 0)
Hope I have explained clearly.
Thank you so much... Thanks a lot...