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 | ||||||
Name | Line1 | Name | Line2 | Name | Line1 | Line2 | ||
A | 10 | B | 5 | A | 10 | 0 | ||
B | 4 | C | 8 | B | 4 | 5 | ||
C | 50 | E | 7 | C | 50 | 8 | ||
D | 20 | D | 20 | 0 | ||||
E | 3 | E | 3 | 7 | ||||
F | 4 | F | 4 | 0 |
Solved! Go to Solution.
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!