8 Replies Latest reply on Jun 10, 2013 4:05 PM by Jonathan Drummey

# How to change AGG function

Hello,

I have a column calculate the sales by segment (so it is Aggregated function), but the Grand Total Line also is a calculation (AGG), but i want it to calculate as normal SUM.

Right now The Grand Total is 323,224.81 but I want to it show as 268,866

 Segment 1 \$29,845 Segment 1 \$29,845 Segment 2 \$7,808 Segment 2 \$7,808 Segment 3 \$46,162 Segment 3 \$46,162 Segment 4 (\$3,118) Segment 4 (\$3,118) Segment 5 \$18,536 Segment 5 \$18,536 Segment 6 \$1,655 Segment 6 \$1,655 Segment 7 \$575 Segment 7 \$575 Segment 8 \$6,730 Segment 8 \$6,730 Segment 9 (\$5,256) Segment 9 (\$5,256) Segment 10 \$54,266 Segment 10 \$54,266 Segment 11 \$65,996 Segment 11 \$65,996 Segment 12 \$10,949 Segment 12 \$10,949 Segment 13 \$34,717 Segment 13 \$34,717 Grand Total By SUM \$268,866 Grand Total By AGG 323,224.81

Thanks for the Help

• ###### 1. Re: How to change AGG function

Hi Nicholas:  Can you post your data in a packaged workbook so we can play with it?  Thanks!

Getting the Most From the Tableau Forums

• ###### 2. Re: How to change AGG function

Also, understanding what an AGG is is helpful.  You cannot sum an agg, because it is already aggregated--however, you can disaggregate.

From Tableau:  You change the aggregation state by selecting the Analysis > Aggregate Measures menu item.

Aggregations:

Aggregations

Example – Aggregate Calculation

Aggregating Data

Some more helpful info from Tableau:

Tableau also allows you to view data in disaggregated form (relational databases only). This is an extremely powerful feature. When data are disaggregated, you can view all of the individual rows of your data source. For example, after discovering that the sum of sales for rubber bands is \$14,600, you might want to see the distribution of individual sales transactions. To answer this question, you need to create a view that shows individual rows of data. That is, you need to disaggregate the data (refer to How Aggregation and Disaggregation Work). Also, one way to look at disaggregated data is to view the underlying data that’s displayed in a table.

So, there's definitely a way.  If you post a sample, someone on the forum will show you how!

• ###### 3. Re: How to change AGG function

Okay. I attached the Workbook.

IF i unchecked the AGG analysis, i cannot see the grand Total

• ###### 4. Re: How to change AGG function

Hi Nicholoas,

Can you re-attach the workbook making sure to save it as a twbx file?

Thanks!

-Tracy

• ###### 5. Re: How to change AGG function

Ooops. Sorry for the inconvenience. Please try again

• ###### 6. Re: Re: How to change AGG function

See the attached, I set up one calc to return the desired result, you'll need to make similar changes to the rest of your calcs. The reason why is that Tableau computes grand totals not as the sum (or avg/min/max/etc.) of the displayed marks, but as a separate computation at a less granular level of detail. See http://drawingwithnumbers.artisart.org/customizing-grand-totals-part-2/ for details on this technique.

• ###### 7. Re: Re: How to change AGG function

Thanks! but there is overlapping Text problem. How I solve that?

• ###### 8. Re: Re: How to change AGG function

The IF FIRST()==0 condition takes care of the overlapping text, you're going to need to use that for every measure on your worksheet. What I'd posted just demonstrated that for the Incremental Sales measure.

1 of 1 people found this helpful