7 Replies Latest reply on Oct 31, 2015 4:54 AM by jonathan.o'grady.0

    Follow customer behaviour with Sankey


      Dear fellow Tableau fans!



      I am throwing myself on the benevolence of the community looking for some help to put together my first Sankey diagram.



      There is quite a bit on these pages regarding assembling such a diagram, but I seem to be missing a step and have got myself into a bit of a muddle… In short, I'm stuck!



      Please find attached a packaged workbook of retail data.



      I have customer orders by retailer, by category and subcategory, by date.



      I would like to analyse how customers switch between retailers within a category/subcategory over two periods.



      At this stage, I'm only interested in the number of customers, not how much they spent. So for example:



      In period one, customer 123 records a transaction with retailer A in category 1



      In the contrast in period, the same customer records transactions in the same category, but this time with both retailer A and retailer B



      In my Sankey, there will be a stacked bar of all customers by retailer on the left-hand side, representing period 1. There will then be a stacked bar of all customers by retailer on the right-hand side, representing period 2.



      In the above example, customer 123's order is recorded as a single unit with retailer a on the left-hand side, which is then split into two half units on the right-hand side - one half unit flowing to retailer A and the second half unit flowing to retailer B.



      Likewise if a customer purchases a subcategory from two retailers in the first period, but only from one retailer in the second period, this will be two half units on the left-hand side flowing into one full unit on the right inside.



      In this way, if you start with 1000 customer orders  on the left-hand side, you should end up with 1000 customer orders on the right-hand side. The only difference will be how they are apportioned to each retailer.



      In aggregate, this should display customers who first shopped with retailer A and continue to shop with retailer A, or if they switch to other retailers.





      I would like to try and do as much of this in tableau as possible, as the ultimate point of delivery will be served to stakeholders via tableau online, updating daily.



      In the attached workbook you will see that I have created dynamic sets to capture customers by period. This appeared to be working well, but unfortunately there are some periods where, at the subcategory level, a customer does not purchase in that subcategory in both periods. Try as I may, I seem unable to filter out these instances, resulting in uneven stacked bars.



      And all of this before I even get to the complicated curved lines in the middle!



      I know that this will be a very effective visualisation (know? Hope!), but I'm going to need a small bit of help from some of the more experienced users here…



      As always, very grateful for all suggestions. Pint of Guinness in Dublin on me for the most helpful answer!



      Best wishes,