I couldn't find the answer to this question anywhere else on this forum, so I apologize if this has been asked before.
I'm trying to enter a regex function into an if field so I can identify certain data sets. In this case, I'm trying to apply an if function to records that contain a date in "mm/dd/yyyy" format at the beginning of the record and end with either a percentage sign (%) or a decimal followed by two numbers.
An example of a record might look something like this: "03/23/20 12.000 210.6380 2,527.65 379.9100 4,558.92 2,031.27 7.68 0.16%"
Or this: "03/23/20 14.000 306.0690 4,284.97 435.3100 6,094.34 1,809.37"
If a record contains something within either format listed above, then I want a new field to display "Format 3."
I'd really appreciate if someone could help point me in the right direction. Thanks!
Solved! Go to Solution.
Something like this?
Appreciate if you would mark it as acceptable if you think it works for you.
Hi @wht822 — Try this solution:
REGEX_Replace([Field1], "^(\d{2}/\d{2}/\d{2}\s.*)(?=\.\d{2}%|\.\d{2})", "")
then
IF REGEX_Match([Result], "^\.\d{2}\%$") OR REGEX_Match([Result], "^\.\d{2}$") THEN
"Format 3."
ELSE
Null()
ENDIF