If I understand what you are trying to do (a cross join to get all possible combinations of brands, weeks, and countries), then this is how I would approach it.
- For each input, add a calculated field. I've named mine Join and the code is the single hard coded integer 1. This will be used to cross join all the inputs.
- Then join them together (not union) on the Join field. That will match every row on one side with every row on the other (a true cross product). You'll have to accomplish this with two separate joins:
- You can then remove the Join fields after the join as they are no longer needed
I've attached an extracted Tableau Prep flow file (.tflx) which includes the data I mocked up. For reference, if you just attach a .tfl file, then no one will be able to use it because it does not include the data (you can save it as that type or export a packaged flow from the File menu).
Hope that helps!
Cross Product.tflx 9.8 KB
Thanks Joshua! That helps!
Got it, will do with a packaged flow next time