Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Using the ? wildcard in Alteryx

Highlighted
5 - Atom

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:

aesojka_0-1593196992660.png

 

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

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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.

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@CharlieS 

 

I'm channeling the inner @AdamR 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

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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.

Highlighted
5 - Atom

Thank you everyone! This really helped!

Labels