Unionising and Joining Data in Tableau Prep and Alteryx

by Cammy Phillips


A Join

If you join data, you can match tables with an identical column and will extend the resulting table by adding additional columns.

  • An example of when this would be useful is when looking at sales data and targets for items in a store. Initially you may have a table of targets for products and a separate table with the sales data for each product. You can join the data by the product names/code column to compare sales v.s target in one table.

Examples

Tableau Prep
Alteryx

Results in

Table A

Table B
Table AB (Result)


You can see here that we have joined the two tables by the store name. A helpful hint about using this method is that it does result in duplicated joined rows -  feel free to hide or delete these rows post joining

One thing to consider when joining data is what type of join you would like to do. Depending on your data and what questions you would like to answer from it different types may be appropriate.

Only output the data that is found both tables

Only output data from the table that came in to the join on the left or only from the right

Only output data from the left/right table that was not also found in the right/left table

Only output the data that was found in the left and right table that was not found in both tables.

Output all data from left and right tables

A Union

If you unionise data you can combine two or more tables with identical columns to extend the tables with additional rows.

  • An example of when this would be useful is when comparing sales data between two different stores but looking at the same sales parameters.

Example


Alteryx
Tableau Prep

Results in

Table C
Table D
Table CD (Result)


We have unionised two tables (C and D) to create a new table (CD) that will have additional rows. If the input tables (C or D) consist of 20 rows each, the output will have 40 rows.