6 Replies Latest reply on Nov 13, 2014 8:22 AM by Matt Lutton

# sum(a) + sum(b) <> sum(a + b)

Hello, can anyone let me know under what conditions could that be possible?

I'm totally perplexed how that can be, especially as meaures a & b are directly from the data.

What is Tableau doing? or what have I done in Tableau to cause that?

Any clues would be much appreciated,

cheers

td

• ###### 1. Re: sum(a) + sum(b) <> sum(a + b)

You'll need to provide a Tableau Packaged Workbook and detail your issue if you want specific help.

• ###### 2. Re: sum(a) + sum(b) <> sum(a + b)

Hi Tom,

Could you share a sample data set and workbook showing the difference your have found? This is just to analyze your view configuration and determine the conditions that give that result.

Best

Ramon

• ###### 3. Re: sum(a) + sum(b) <> sum(a + b)

I agree that a packaged workbook (TWBX) file is needed to help you.  But it sounds like you may be confused about Row-level calculations versus Aggregate calculations -- this may help you:

http://www.theinformationlab.co.uk/2012/03/27/tableau-for-excel-users-part-2-calculated-fields/

With SUM(A) + SUM(B), you will get the aggregate results of each, summed to the level of detail you've set in your visualization (this is determined by the Dimensions you've placed in the view/worksheet).

With SUM(A+B), you are adding the A and B values for each record (at a row level), and then aggregating up to the level of detail in your visualization (again, this is set by the Dimensions in your view).

You should be able to determine the difference by studying the Summary and Underlying data Tableau is providing you with.

• ###### 4. Re: sum(a) + sum(b) <> sum(a + b)

I also highly recommend the following videos, which help add clarity to how Tableau works at a very basic level (the importance of Dimensions versus Measures is highlighted in the first video, and the second video discusses the different types of calculations you can create in Tableau -- the difference between row level and aggregate calcs should be a bit more clear after studying these links provided)

Understanding Pill Types | Tableau Software

Aggregation, Granularity, and Ratio Calculations | Tableau Software

• ###### 5. Re: sum(a) + sum(b) <> sum(a + b)

Hi Matthew, thanks for pointing me in the right direction. Cannot easily post the twbx due to data sensitivtiy... cheers

td

• ###### 6. Re: sum(a) + sum(b) <> sum(a + b)

You can create some rows of sample data in Excel, and use those as the basis for a pacakged workbook.  Nearly everyone on the Forum works with some sort of confidential data, but we have to find ways around that.

Here's a great post on how Tableau makes creating sample TWBX files easy:

Re: Guidelines for posting data/tbwx files

You could simply create a couple of Columns in Excel, A and B, and create some mocked up rows of data, and use that as the basis for an example in this particular thread.  We only need enough data to replicate the issue, so its often easier to create your own data for an example.  However, you could also demonstrate the concepts by using one of the sample datasets that ships with Tableau, like the Superstore Sales dataset.  You'd simply reference different fields, but the concept of an aggregate versus a row-level value would still hold true.

Let us know if you need further help.