Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
One more question in writing a If condition!!
I am trying to filter data using if condition where I need to compare two fields. For example:
Let the fields be
1.Flag: which has only 1 and 0 value in it.
2. Name: This field has data something like this
Name
abc
bcd
rfg
3. Cname
4. Num : This field has data something like this :
Num
1234557
4567869
7864325
abc_123
bcd_567
rfg_675.
Note :Starting of some data in Num field resembles the data in Name. For example
Name Num
abc abc_123
bcd bcd_567
rfg rfg_675.
I need to bucket in the data for a field called "room" for a condition
Flag =1 or
Num = only that data which Starts with Name field.( Example = abc_123, bcd_567, rfg_675).
So expression should be like
If( Flag ='1' or Num = ' Like Name', Name, Cname) as room.
I hope I have explained in a simple way. Thank you.
Regards,
PV
There was a Typo. Please use below expression
if( Flag=1 or WildMatch(Num, '*' & Name & '*'), Name, Cname) as room
Hi,
Try below script.
if( Flag=1 or WildMatch(Num, '*' & Name & '*', Name, Cname) as room
There was a Typo. Please use below expression
if( Flag=1 or WildMatch(Num, '*' & Name & '*'), Name, Cname) as room
May be use this If( Flag =1 or Num like Name, Name, Cname) as room
Hi Krishnapriya,
Thanks for the reply, I am getting the data when the condition is true but this time it's not bucketing the data if condition is false. That means the values for Cname are not populating.
I have verified with sample data, both true and false case is working fine.
Please find attached sample.
share me the false condition which is failing.
Thank you Krishnapriya, it's working.
Great. Please mark the correct answer and close the thread.