Alteryx Designer Desktop Discussions

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

Find and Replace data

dareinnyc
7 - Meteor

Hi, I am looking to use the multi-formula tool (or any other tool) to find an replace any items starting with "U" within the data field [Grade Level] to a static "10".

 

In this instance, i have several rows with U10, U20, U21.. and i would like to replace all of them to "10". 

 

Thank you

5 REPLIES 5
jrgo
14 - Magnetar

@dareinnyc 

 

I think a normal formula tools would work, if it's only against one field. Here are some options...

 

REPLACE([Grace Level], 'U', '')
TRIMLEFT([Grace Level], 'U')
JoshuaGostick
11 - Bolide

Hi @dareinnyc,

 

Would something like the formula below work for your needs?

 

IF StartsWith([Grade Level], "U")
THEN "10"
ELSE [Grade Level]
ENDIF

 

Thanks,

Josh

dareinnyc
7 - Meteor

Thanks! That worked! To take it one step further.. if I want to tag each combination to a different number, how do I do it? A multi-formula tool?

 

U20 tagged to 9

U21 tagged to 10

U22 tagged to 11

0000 tagged to 9

 

Note that the last one doesn't have a "U" in front of it.

 

 

 

JoshuaGostick
11 - Bolide

If that is the case, and you only have to change these 4 values, then it's probably easier to simply create a longer IF statement.

 

So for example:

 

IF [Grade Level] = "U20" THEN 9

ELSEIF [Grade Level] = "U21" THEN 10

ELSEIF [Grade Level] = "U22" THEN 11

ELSEIF [Grade Level] = "0000" THEN 9

ELSE [Grade Level]

ENDIF

 

Then, you can just add to this if you don't have too many other values to change.

 

Josh

 

 

 

Hadzramin_Rahman
8 - Asteroid

Hi @dareinnyc 

 

You can try to use Find Replace Tool

 

Workflow

 

hadzramin_0-1572629618167.png

 

 

Lookup_Replace_Value text input

 

hadzramin_1-1572629866112.png

 

 

Result

 

hadzramin_1-1572629641216.png

Labels