I am trying to grab three-letter currencies from a field and move/replace them, but I cannot seem to get the ? wildcard to work.
Here is a screenshot of my data:
For every currency (in this instance, "USD"), I would like to:
1) Move "USD" to a new field, and
2) Replace "USD" with the 0.00 in the "Prior Accrued" field
Any thoughts/suggestions? I tried this multi-field formula for 2) and it did not work.
IF Contains([SECURITY NO QUAL], "???") THEN [PRIOR ACCRUED] ELSE [SECURITY NO QUAL] ENDIF
Solved! Go to Solution.
hI @aesojka
I think this called for RegEx. Try a Multi Field formula with this tool:
If REGEX_Match([SECURITY NO QUAL],".{3}") THEN [SECURITY NO QUAL]
ELSE [_CurrentField_] ENDIF
Which says if the [SECURITY NO QUAL] field is strictly 3 characters long, then use that field. Otherwise, leave the current value of the fields. I've attached an example.
I'm channeling the inner @AdamR_AYX in me.
IF
Length([Security No Qual]) = 3 THEN [Security No Qual]
ELSE
[_CurrentField_]
ENDIF
That expression performs 3x faster and is easier on the eyes. We can additionally check to see if it is all alpha if needed without RegEx.
Cheers,
Mark
You're absolutely right, the string Length( function will achieve the same goal and process much faster. How funny, it's typically you suggesting RegEx and me suggesting the standard string functions. I guess "wildcard" got me focused on RegEx.
Thank you everyone! This really helped!