Is it possible to do a regex_match of mutiple fields containing multiple keywords?
For e:g can I do . if REGEX_Match([Field 1] or Field 2],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*") instead of writing if else if?
Solved! Go to Solution.
You cant use multiple fields in Regex_Match() you would need to use multiple Regex_Match() with And/Or
just write this:
REGEX_Match([Field 1],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*") or REGEX_Match([Field 2],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*")
That will give you what you want if you put in a formula tool (new column type boolean) or you can use it as-is in a filter tool. If that doesn't work and it's enough data - transpose it and use the regex_match formula with [vaue] as your field.
You mentioned, " instead of writing if else if?" Can you provide more info on the usecase so that we can help you out.
IF REGEX_Match([Field 1],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*") THEN 'ENT'
ELSE IF REGEX_Match([Field 2],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*") THEN 'ENT'
ELSE 'IND'
ENDIF
Since you want to check in either of them and you want to use single regexmatch() you can concat the text fields like below. That would create a single concat variable on which match can be applied.
REGEX_Match([Field 1] +"-"+ [Field 2],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*")
IF REGEX_Match([Field 1] +"-"+ [Field 2],".*REALTY.*|.*GROUP.*|.*COLLECTION.*|.*SOCIETY.*") THEN 'ENT'
ELSE 'IND'
ENDIF
Hope this helps : )
How to calc the below...
if a = 'Text without any spaces' then 'ENT'
Thanks in advance!
This would be the formula
IF REGEX_Match([^\s]+) THEN 'ENT'
ELSE 'IND'
ENDIF
Hope this helps : )
If above responses helps please don't forget to mark it as solution.
where in this calc will I plug in the field that I'm using for calc?