Hello, I am fairly new to Tableau and I have a problem that I think (hope) is relatively simple.
I have created a very simple example of the problem below and included this simple dataset in a packaged workbook for your convenience.
I am using Tableau version 10.4
I have a products table as follows
From this I want to be able to filter on a product and show what other products those customers also purchased.
For example using the table above if I filtered on Milk I would expect
I would need to select multiple products so if I filtered on Milk and Cheese (asking the question what other products do people who purchase milk and cheese buy)
I would expect
I am really stuck as how to do this in Tableau. I would solve this problem in SQL using a subquery along the lines of
Declare @Product varchar(10)
SET @Product = 'Milk'
SELECT products,count(customer_ref) as counts
WHERE products NOT IN(@Product) AND
(SELECT prod_sub.customer_ref AS prod_sub_customer_ref
FROM #prodTable AS prod_sub
WHERE products IN ( @Product)
GROUP BY prod_sub.customer_ref)
GROUP BY products
In Tableau I originally thought I could solve this using a parameter but I can't seem to get round the problem of needing to filter on multiple products.
I had the most success creating two identical datasets joining them and doing a filter on one but I struggled to exclude the original filtered products.
Many thanks for looking at this - I am sure I have missed something simple and look forward to your responses
food_example.twbx 11.4 KB