Blog post written by Ben Moss
No Append, No problem: How to append in Tableau Prep
The purpose of appending data sources together is to bring all lines in one datasource (usually a small number) against every line in a larger dataset. If I have one line in my smaller set, then my dataset will remain the same size; if I have two lines it will double, and so on.
The easiest example is when trying to add a total column to your dataset.
You have used the aggregation tool to create your ‘total sales’, and now want to bring this in line with all of your data, so you could work out a % of total for instance.
In order to append the two streams together I will use the following logic.
- With each of your streams, use the step function to add a new column to this dataset, the value we will return for this column will be ‘JOIN’, and I will title this column ‘APPEND’
- Now we have a common field in both datasets, as a result we can join on this field
- You’ve now dsuccessfully achieved an ‘append’ of two datastreams. In the instance of my example, I can now perform a calculation to understand the % of total value for each line, this can be achieved using the step function.
I hope this post was useful, and I hope it prevents people thinking an append is not possible with Tableau Prep! It certainly is, and it’s relatively straight forward!
The sample workflow used in this post can be found here for your reference.