The Append tool in Alteryx is very useful tool to do the cross join(that makes all combination from two datastream). For example, the most famous use case is to get the percentage each record of the total. First you get the total by the Summarize tool and then add it to the all records by the Append Fields tool. Finally, you can calculate the ratio by the Formula tool.


In this post, I would like to explain the differences of the input anchors of the Append Fields tool

The difference of the T input and S input
T input and S input look the similar. Normally we understand that the data from S input is joined to the data from T inpus by cross join.
However, there is an obvious different from T input and S input. What do you think that you swap T input and S input?
For example, we would like to consider the case below. Suppose that you want to count the number of times the sales amount exceeds 500 in dataset A, and use the Append Fields tool to add a flag whether it is greater than 5 or not in dataset B.

Actually, there is no records more than 500 in Dataset A. So the summarize tool returns null record. As a result, the Append Fields tool add null to the Dataset B. The final result is as follows.

In this case, you should use Count Records tool instead of the Summarize tool. But the result is correct because the count is less than 5.
If you swap the T input and S input in this case, what happens? The workflow that you swapped the inputs is as follows.

The final result at the Browse tool is as follows. It’s null!!!

This means that the data from Dataset A coming from S input is joined to the data from T input. The main focus here is on the T input side. So, if there is no data from T input, the output will always be null.
The correct workflow is as follows. You should use the Count Records tool instead of the Summarize tool.

Conclusion
- The Append Fields tool is a tool that appends the S input to the T input, so if the T input is Null, the output will be Null.
Sampleworkflow download
Contents of the next blog
The next post will be a tip about the Union tool.
コメント