In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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
Top Solution Authors