Alteryx Designer Desktop Discussions

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

Create a new column using Formula

Jaganmohan
8 - Asteroid

Hi Alteryx Support - Need assistance from your side on below logic - Thanks in advance.

I need to create a new column based on Identifier field like below shown.
If identifier contains 7 Character then ISIN,
IF Identifier contains 9 then Cusip. 

     
 Input   
     
 IDIdentifier  
 1XFPUTH3  
 2RFPTYH3  
 3RFPTYH3  
 478TYHJGHF  
 5U8TYDSGHF  
     
 Output   
     
 IDISINCUSIP 
 1XFPUTH3  
 2RFPTYH3  
 3RFPTYH3  
 4 78TYHJGHF 
 5 U8TYDSGHF 
     
     

 

2 REPLIES 2
ShankerV
17 - Castor

Hi @Jaganmohan 

 

Please use the below, 

 

1. Formula tool

 

Add Column name -> ISIN

IF length([Identifier])=7

THEN [Identifier]

ELSE null()

ENDIF

 

Add Column name -> CUSIP

IF length([Identifier])=9

THEN [Identifier]

ELSE null()

ENDIF

 

Optional Step 2: If you need to remove the column Identifier post step1, then use Select tool to deselect the column.

 

Many thanks

Shanker V

cjaneczko
13 - Pulsar

Try this. 

 

image.pngimage.png

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels