Alteryx Designer Desktop Discussions

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

Check number of values and return value

tiverson
8 - Asteroid

Hello,

 

I have a data set that I need to check the number of characters in a specific column, then return a value.

I want to check the Assignment column for 18 digits (including the slash)

Data:

tiverson_2-1676554395747.png

 

 

Output:

Create a new column title "Contract type"

In Contract type column add the following values"

1 - If there is not 18 digits or blank, then default to "Fleet" for contract type

2 - If there are 18 digits then check the 5th digit.

3 - If 5th digit is 1 then "Fleet", if 2 then "Machinery", if 3 then "Other", if 4 then "Real Estate"

tiverson_3-1676554737522.png

 

2 REPLIES 2
DataNath
17 - Castor

Hey @tiverson, does this look like what you're expecting?

 

DataNath_0-1676555356273.png

 

Quick edit: With the above approach, this assumes that there's only ever 1/2/3/4 as the 5th character. If you need it to handle more possibilities then you can use the below. It's currently set to null() anything not 1-4 so just change that to whatever it needs to be.

 

DataNath_0-1676555588076.png

tiverson
8 - Asteroid

Thanks @DataNath 

Labels