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?
Hi @Idyllic_Data_Geek
My bad use this formula
IF !REGEX_CountMatches([Field1], ".*\s.*") THEN 'ENT' ELSE 'Other' ENDIF
Workflow:
Hope this helps : )
You cant use multiple fields in Regex_Match() you would need to use multiple Regex_Match() with And/Or
Hi @Idyllic_Data_Geek ,
You can use AND/OR keywords if you need to combine two regex conditions.
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'
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'
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?