Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!
alteryx Community

# Alteryx Designer Desktop Discussions

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

## creating new column based on null and non null values of existing column

8 - Asteroid

Hi Community,

I'm having column A which has null values and non-null values and I want to create column B. Can you suggest me formula for that?

If isnull(col A) THEN (col B) = 'Web' ELSEif  (col A)='1111' then (col B) = 'Mobile' elseif (colA) ='2222' then (col B) ='IPAD' else (col B) = 'SOURCE UNKNOWN' ENDIF

Is the above formula right? can someone tell me the right formula? I'm attaching the excel file as well. Thank you

3 REPLIES 3
Alteryx

Hi @srk0609 , the formula for Column B would be as follows. Ensure that Column A is datatype string for this formula to work.

if isnull([col A]) then "Web" elseif [col A]="1111" then "Mobile" elseif [col A]="2222" then "IPAD" else "Source Unknown" endif

Alteryx Alumni (Retired)

Hi @srk0609

I have provided a sample WF that shows the formula you are trying to use.

Hope this helps.

16 - Nebula

Hi @srk0609

You can use this one. Just be sure that your col A field is a numeric field. If it is not, then the 1111 needs to be '1111', 2222 needs to be '2222'....

If isnull([col A]) THEN 'Web'
ELSEif [col A] = 1111 then 'Mobile'
ELSEif [col A] = 2222 then 'IPAD'
ELSE 'SOURCE UNKNOWN'
ENDIF

Labels