Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys. Quick question. I want to create a derived field on top of one of my tables using an if statement.
If I want to do something of the sort like this: if FieldA = {'A','B','C'}, I have had to write it all out like if(FieldA = 'A' OR FieldA = 'B' OR FieldA = 'C', ...)
Is there an easy way to combine them into a set rather than expanding it all out using ORs?
Cheers,
Eric
Yep:
if(match(FieldA,'A','B','C'),...)
And while it doesn't matter here, the match() function returns the position in the list of the first match. So if FieldA = 'B', it will return 2. If it matches nothing, it returns 0. That's sometimes useful.
Yep:
if(match(FieldA,'A','B','C'),...)
And while it doesn't matter here, the match() function returns the position in the list of the first match. So if FieldA = 'B', it will return 2. If it matches nothing, it returns 0. That's sometimes useful.