I have an Excel document that looks somewhat like this:
| Type | Amount | Days without | Days with little | Days with lots |
|---|---|---|---|---|
| Tolerable | 5 | 148 | 271 | 206 |
| Less tolerable | 4 | 295 | 162 | 258 |
| A little intolerable | 9 | 195 | 234 | 159 |
| Intolerable | 13 | 277 | 133 | 115 |
I'd like to put Type and Amount into a pie chart. Furthermore I want to split each pie section into its other 3 columns, Days without, Days with little and Days with lots.
Sunburst seemed like a good choice to me. However for it to work I need to restructure it into some hierarchical table.
| Result | Input | Factor | ||
|---|---|---|---|---|
| Tolerable | Days with | 740 | 148 | 5 |
| Days with little | 1355 | 271 | ||
| Days without | 1030 | 206 | ||
| Less tolerable | Days with | 1180 | 295 | 4 |
| Days with little | 648 | 162 | ||
| Days without | 1032 | 258 | ||
| A little intolerable | Days with | 1755 | 195 | 9 |
| Days with little | 2106 | 234 | ||
| Days without | 1431 | 159 | ||
| Intolerable | Days with | 3601 | 277 | 13 |
| Days with little | 1729 | 133 | ||
| Days without | 1495 | 115 |
This gives me the result I'd expect:
I have a large dataset however and converting it all into some hierarchical data seems way too inefficient to me. Is there an easier method to get this done?
1 Answer
Reformatting data for a sunburst chart is a bit awkward, but here's a way to cut down some of the tedious steps.
First, use Data>Get & Transform Data>From Table/Range.
This will open a query against your source data:
Select the three right-most columns and use Transform>Unpivot Columns, so you get this:
Use Add Column>Custom Column, configured like this:
So you get this:
Use Home>Close & Load To, like this:
Configure the pivot table like this:
If your row headers have repeated values in each row of the 'Type' column, use Design>Report Layout>Do not repeat item labels so the pivot table looks like above.
Now select the entire pivot table and copy it. Paste Special as Values in some other sheet. Use the pasted result as the source of your sunburst chart.
2