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!

Alteryx Designer Desktop Discussions

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

Add a new column with some value, fill the rest with 0

zoeuno
7 - Meteor

I'm working on a project and got stuck on this step, where I want to add a new column to an existing data set, but the new column only have information for a few rows, and I want to fill the rest with 0. As can be seen below, input 1 represents the existing data set, and input 2 only have data on three rows (names), for the output I want to add line 2, and fill the rest with 0. Is that possible?

 

Input 1  Input 2  Output  
NameLine1 NameLine2 NameLine1Line2
A10 B5 A100
B4 C8 B45
C50 E7 C508
D20    D200
E3    E37
F4    F40
1 REPLY 1
Kenda
16 - Nebula
16 - Nebula

Hey @zoeuno! I would suggest using a Join tool with your two inputs, joining on Name. I would then use a Union on the L and J outputs from the join (assuming input 1 is on the left). Finally, I would add a Formula for the Line2 field that says:

IIF(isnull([Line2]), 0, [Line2])

Hope this helps!

Labels