Would you be apposed to creating two sheets, with 1-4 filtered in Sheet A and 5-8 filtered in Sheet B then adding them both to a dashboard?
Joe, I agree with Tom W solution and we should go in that route to accomplish your requirement...
I did a similar thing to this earlier today. The context was different, I had to stack two lines on top of each other - one for 2015 and one for 2016. We're comparing similar time periods in the year but we want to show the 2016 date on the X axis. If we use the real date, we'll see 8/1/2016 and another 'column' for 8/2/2015. So, I had to create calculated field to effectively say IF YEAR(Date) = 2015 then dateadd('day',-1,Date) else Date end. This faked my date and now I ended up with one column.
Using that as my inspiration, I came up with this (note the headers for the dimensions are still visible in my sample below to help with the explanation. They are obviously hidden in the final output);
There are two fields driving this; ColumnNumber and RowNumber and one which isn't visible, Index.
Index; Straight forward enough, it's just an index calculation so I can number my sub categories between 1 and 17.
> This uses the modulo (mod) operator to calculate the remainder when you divide the Index by 2. I'm multiplying by negative one to force a sort so 'Fasteners' moves up to the top row.
> Assuming the index is sequential (which it is) we effectively end up with a series of numbers returned as -1,0,-1,-0,-1,-0 etc. Run this in Excel to test it if you want - fill numbers 1 through 16 down the rows and type in a formula = MOD(A1,2)
> Straight up, divide the index by two and round the number to 0 decimal places so we force an integer and you've got yourself a sequence of 1 through 9
All three fields have their table calculation partitioning set to 'Sub Category'.
Then I just threw a simple pie chart in there for Profit and Sales and used the sub category as my label. I'm hoping you can use the same method to split your donuts up without screwing the data! Of course if it doesn't work, go with my earlier and significantly easier response of two sheets with filters and a dashboard.
RowsOfPies.twbx 1.2 MB
Tom - I love the creativity behind this. This is definitely where my head was going when I built the Row and Column calculations, but yours is certainly more complex. That said, given that I am using donut charts (which have a bit of Tableau hackery already going on), I opted to use your first approach and just wedge two sheets into my dashboard (I'm embarrassed that I pored over the complicated attempts without thinking of that simple one). I ended up using a table calc to give me a rank, then put the donuts ranked 1-4 on the top sheet, and 5-8 on the bottom (because I wanted my highest volumes on the top row).
I'll certainly keep the complicated solution in my pocket for future reference, but will mark the two sheets as the correct answer.
I've never gone through the process to 'hack' the donuts (because I adhere to the 'friends don't let friends use piecharts' )
However, it seems to me like I'd just make a pie chart and stack a white circle on the middle right? So I would need dual axis for that.
I setup a field called 1 which just has a value of 1, then I add MIN(1) to the rows shelf twice and set it up as a dual axis. I see you've used MIN(Number of Records) to achieve the same thing. I prefer MIN(1) as it's constant and it means I can set axis ranges accordingly.
I kept my first mark as a pie, but I changed it from two measures to be just the sales measure, colored by region.
Then my second mark is a circle, colored white and sized based on preference. I added the profit ratio as a label in the middle and boom.
I'm glad the first approach worked though, sometimes the simple solves are the best.
Either way though, if you could select a response as the correct answer to close out the thread, that would be excellent. EDIT: I see you've already done so. thanks!
rowsofdonuts.twbx 1.2 MB