
Hi All,
Will need advise on Joins and Unions. I have taken multiple datasources and joined it in Tableau. Now I wish to union the joined tables with itself. Is it possible? Or do I have to do it in Prep and then after I publish the data source then do the union to itself?
For example if I have joined the below tables and call the final table 'Returndetails', is it possible the make a union of 'Returndetails' to itself? The final union should have an auto populated column [Table Name] with half of the rows having alias as "Returndetails.txt1" and the other half as "Returndetails.txt". If it is not possible can I please get an alternate way to achieve this.
Thank you
Regards,
RS
Definitely easier to do in Prep, but can be done in Desktop too. Instead of doing a union, I'd suggest another join. For example, using Superstore, I could do something like what you have above.
Next I can create another table (in Excel or CSV or whatever) that looks like this:
Table NameReturn Details 1Return Details 2You can then add that in as a data source.
Then perform a cartesian join (or cross-join) to the other tables using join calculations where both sides are 1.
You'll now have two duplicate sets of data.
See attached.