Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Using the ? wildcard in Alteryx

aesojka
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

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

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.

MarqueeCrew
20 - Arcturus
20 - Arcturus

@CharlieS 

 

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

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
CharlieS
17 - Castor
17 - Castor

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.

aesojka
5 - Atom

Thank you everyone! This really helped!

Labels