Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

replacing [NULL] value with a string from another column

dattina2287
8 - Asteroid

hi,

 

i'm new to Alteryx and trying to solve for an issue where i have 3 columns of names - first, middle and last. The middle name/initial is only populated in a few rows which pushes the last name to the third column in some cases. In most cases, the last name is in Column 2 so Column 3 is [NULL]. I changed [NULL] to 0 and now i want to replace the 0s in Column 3 with the value in Column 2. If there's an actual last name in Column 3 then i would like to keep that value. This would leave me with the few last names that were already populated in Column 3 and then essentially move the last names from Column 2  over to Cso that i'm capturing all last names in one column. 

 

i am trying an IF statement with Replace but it's not working. i think there's a way to also use ISNULL but i couldn't figure that out so i changed NULL to 0. i know this is not right but i'm showing what i was trying just in case it helps.

 

IF [Receiver Name3]="0" THEN Replace("0", [Receiver Name3], [Receiver Name2]) ELSE "" ENDIF

 

Can anyone offer any insight?

 

Thanks!

4 REPLIES 4
digitalmemo
8 - Asteroid

not sure if I got the scenario right nor this is the most efficient solution but see if this works.

Qiu
20 - Arcturus
20 - Arcturus

@dattina2287 
I think you are almost there but might be confused with the Replace Function.

Your target here is to check if the Column is equal to zero.

If yes, then use the value from Column 2, if not, then keep as it is.

 

IF [Receiver Name3]="0" THEN [Receiver Name2] ELSE [Receiver Name3] ENDIF

 

dattina2287
8 - Asteroid

this worked perfectly! Thank you so much!

Qiu
20 - Arcturus
20 - Arcturus

@dattina2287 
Thank you for the feedback 😁

Labels