I follow this great post about how making a basket market analysis via a self join inside tableau (see here: http://kb.tableausoftware.com/articles/knowledgebase/market-basket-analysis).
The previous tutorial uses number of lines to display the result. I would like to display calculated Cross Revenue in addition to this metric.
For instance : if coffee (2€) has been sold with bread [1€), I would like to display at the intersection of coffee and bread (coffee on the row shelf / bread on the column shelf) 1€.
My dataset is as follow :
transactionID | Category | Products | Revenue |
---|---|---|---|
123 | A | A1 | 10 |
123 | A | A2 | 20 |
123 | B | B1 | 30 |
124 | C | C1 | 30 |
124 | D | D1 | 20 |
When summing the revenue measure, Tableau duplicates the result as self joining retrieve all possible combination at the product level.
I tried a calculated field something like TOTAL(SUM([Source$Revenue])/COUNTD([Products]) but I cannot make it work at the transactionID partition.
Any hints ?
Thanks !
Martin