Alteryx Designer Desktop Discussions

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

How to segregate cell based on the cell value

Gsiva3
8 - Asteroid

Hi Team,

 

I know you can help me on this.

 

I have a column named Input with value as AA#23,BB#2A,CC#G3,DD#GG. My desired output should have the cell values whose 3rd character are number. So, my output column contains only AA#23,BB#2A as per the condition.

 

InputOutput
AA#23AA#23
BB#2ABB#2A
CC#G3-
DD#GG-
5 REPLIES 5
Luke_C
17 - Castor

Hi @Gsiva3 

 

Here's one approach that checks if the character is an integer 

 

if isinteger(substring([Input],3,1))
then [Input]
else null()
endif

 

Luke_C_0-1623335272840.png

 

Gsiva3
8 - Asteroid

@Luke_C 

Thanks Luke👍

Got it done!!

Ar13f
10 - Fireball

Dear @Luke_C 

 

can you explain the logic of the formula below?

 

if isinteger(substring([Input],3,1))
then [Input]
else null()
endif

 

Rgds,

Arief

Luke_C
17 - Castor

Hi @Ar13f 

 

The logic is this:

  1. Substring([Input],3,1) returns the 4th character in the string (remember numbering starts at 0). The syntax of the substring formula is: Substring(String,start,length)
  2. IsInteger() checks if the value that is being processed can successfully be converted to an integer. This function returns true or false.
  3. The if statement is just takes the result of the isinteger and says if it's true then we want to list the entire string, otherwise put null. 

Hope this makes sense.

 

 

Ar13f
10 - Fireball

Dear @Luke_C 

 

Thank you very much for the explanation ..👍

Labels