2 Replies Latest reply on Jan 21, 2013 8:38 AM by James Egan

# How to create graphs using aggregate calculated fields based on metric ranges

We have a dataset that is at the level of detail of customer order.  One record for each customer order.  We need to create a pie chart that shows what percentage of customers, over time, had 10 or more orders, 4 to 10 orders, 3, orders, 2 orders and only 1 order.

I was finally able to figure out how to create a bar chart by using the "level of detail" field.  But I couldn't covert that into a pie chart.  So I ended up creating a pie chart that isn't a typical pie chart.  I used the sort by function to order all the detailed records into each of the five categories.  But I can't show the percentages of each category because the pie chart is just a whole lot of individual records ordered to look as if they are part of a group, such as the group of customers that made 3 orders.

Generally, this raises a question as to how much we can rely on Tableau for reports at a higher level of granularity than our base data set.  Again, our base data set is at the order level.  But this report (pie graph) is really at the customer level.

I've attached a packaged workbook with a subset of our test data if anyone is willing to have a look.

Any suggestions would be much appreciated.

• ###### 1. Re: How to create graphs using aggregate calculated fields based on metric ranges

Hi,

In Tableau when we want to aggregate at coarser levels of granularity than are being used in the view (Tableau automatically will aggregate based on the dimension pills in the view), we turn to table calculations. Here's a set of links to get you started with table calcs: http://drawingwithnumbers.artisart.org/want-to-learn-table-calculations/.

I set up pie and bar charts in the attached. The trick is that the "Orders - Count into Groups" pill needs to have "Ignore in Tablea Calculations" unset so it can be used for partitioning the Count of Orders table calc.

Jonathan

• ###### 2. Re: How to create graphs using aggregate calculated fields based on metric ranges

Great!  Thanks for the link and thanks for sending the corrected workbook back to me.