Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI Friends,
I am trying to write multiple if conditions, if i use one condition i am getting value, but when i am using mutiple conditions i am not getting the value. can any one help me on this. i am sharing sample condition how i written. I have columns like
Status, Comment and Rejected_Rsn. By using these columns i need to write conditions.
Sample:
1) if(status='rejected', if(Rejected_Rsn='id submitted with error', if(wildmatch(Comment ,'*Invalid*','*rejected*'),'Incorrect Value','Ignore'))) as Flag1 // when i written above condition like this i am getting value as expected but when i am adding another condition i am not getting any value in Flag
2) if(status='rejected', if(Rejected_Rsn='id submitted with error', if(wildmatch(Comment ,'*Invalid*','*rejected*'),
if(status='rejected', if(Rejected_Rsn='Not to Fix', if(wildmatch(Comment ,'*valid*','*Closed*','*Not to Fix*')
'Incorrect Value','Ignore'
)))
))) as Flag1
when i was trying second condtion i am not getting values. can any one please help me on this. i have used and/or also i am getting error. Thanks in Advance
Your second expression first tests for Rejected_Rsn='id submitted with error' and again tests Rejected_Rsn for another value: Rejected_Rsn='Not to Fix'. Since a field can only contain one value and not two the result is the combination of these tests is always false. That's why you don't get a result.
Try this instead:
if(status='rejected'
, if(Rejected_Rsn='id submitted with error'
, if(wildmatch(Comment ,'*Invalid*','*rejected*')
,'Incorrect Value'
,'Ignore'
)
, if(Rejected_Rsn='Not to Fix'
, if(wildmatch(Comment ,'*valid*','*Closed*','*Not to Fix*')
,'Incorrect Value'
,'Ignore'
)
)
)
) as Flag1
Your second expression first tests for Rejected_Rsn='id submitted with error' and again tests Rejected_Rsn for another value: Rejected_Rsn='Not to Fix'. Since a field can only contain one value and not two the result is the combination of these tests is always false. That's why you don't get a result.
Try this instead:
if(status='rejected'
, if(Rejected_Rsn='id submitted with error'
, if(wildmatch(Comment ,'*Invalid*','*rejected*')
,'Incorrect Value'
,'Ignore'
)
, if(Rejected_Rsn='Not to Fix'
, if(wildmatch(Comment ,'*valid*','*Closed*','*Not to Fix*')
,'Incorrect Value'
,'Ignore'
)
)
)
) as Flag1
Thank You Gysbert