Alteryx Designer Desktop Discussions

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

Pulling a character from a cell

jlfromm
8 - Asteroid

I have a file that have 4 letter in a cell and I want to just pull the 3 letter out and put in it a new cell. How would I write that formula

 

 

Example 

 

ID

HSDY

New ID

D

5 REPLIES 5
alexnajm
17 - Castor
17 - Castor

What is the expected output for the below data?

kamal03
9 - Comet

Hi @jlfromm ,

 

You can achieve this by using a left function in the formula tool.

Please try this formula to get the desired output.

 

Left([Column], 3)

 

left function.png

jlfromm
8 - Asteroid

in the new column I just want the third character

 

So if the Cell is showing HSDY I want new coulmn to show D

alexnajm
17 - Castor
17 - Castor

Got it - this formula should work then! Substring([Field],2,1)

 

However what if there is no third character?

kamal03
9 - Comet

Hi @jlfromm 

 

In this case , you can use substring formula to get the output.

 

if Length([Column])>3
then
substring([Column],2,1)
else [Column]

endif

 

substring.png

Labels