Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I would like to write an "If" statement that checks the number of characters in a field then return "N/A" if the field contains more than 15 characters, otherwise return the value
I tried this but it doesn't work:
If(Len(GUID>15,'N/A',GUID)) as GUID
Hi Tumelo,
you have brackets in the wrong place, you need to close the Len
If(Len(GUID)>15,'N/A',GUID) as GUID
hope that helps
Joe
Hi Tumelo,
you have brackets in the wrong place, you need to close the Len
If(Len(GUID)>15,'N/A',GUID) as GUID
hope that helps
Joe
Hello,
If(Len(GUID)>15,'N/A',GUID) as GUID
If(Len(GUID)>15,'N/A',GUID) as GUID
hi Tumelo,
i think expression looks wrong, try the below:
If(Len(GUID)>15,'N/A',GUID) as GUID
Thanks guys!
And how do I include another If condition to say If the field GUID is NULL it must also return "N/A" ?
If(Len(GUID)>15 0r Len(Trim(GUID)) = 0,'N/A',GUID) as GUID
0r
If(Len(GUID)>15 0r Len(Trim(GUID)) = 0,'N/A',GUID) as GUID
Note: I was unable to post with "0r" in above condition. Replace number zero by o in above expressions
Just keep in mind, it's also possible to nest if statements:
If (Len(GUID), 'N/A', if(Len(GUID)>15, 'N/A', GUID)) as GUID
But of course, for this specific problem, anbu's solution looks better
Thanks guys! again