7 Replies Latest reply on Nov 3, 2017 6:40 AM by Balaji Subramani

# Summing an Aggregated Calculated Field

Good morning everyone,

I'm struggling to create a calculated field that totals the sum of an aggregated field, that varies depending on the filter.  Currently my incremental order grand total field calculates exactly like the sub categories. shown below.

As you can see the total orders don't equal the sub category total. I realise I can change the Grand Total field and change the equation type to sum to equal this, but I need the overall value correct so that the Total Incremental Cost Per Order (ICO) changes.  For Example. My current incremental orders results in a ICO of £7.66. In reality it should look more like £30.

The image below shows the Incremental Orders I require, with the ICO resulting in 77,704.00 / 4,579 = £17

I've attached the equations above.

Joel

• ###### 1. Re: Summing an Aggregated Calculated Field

Hi Jeol

Have you tried TOTAL(SUM([Total cost of milling])/ [total incremental orders]

Thanks

Akram

• ###### 2. Re: Summing an Aggregated Calculated Field

Hi Akram,

I should have posted above that my Total Cost of Mailing is also an aggregation. Tableau won't sum it again.

1 of 1 people found this helpful
• ###### 3. Re: Summing an Aggregated Calculated Field

Hi Joel,

Just add TOTAL function like below:

Rewrite the Total Cost of Milling calculated field as TOTAL(sum([Total Responsive Costs])]))

• ###### 4. Re: Summing an Aggregated Calculated Field

Hi Akram,

I changed my calculated field to your suggestion. It had no impact on the final result, still remaining £7.66

1 of 1 people found this helpful
• ###### 5. Re: Summing an Aggregated Calculated Field

Oops!

Add Total function to Total Incremental Orders calculated field as well and try again!

It should work. If its not done even after that if possible share your twbx file. I will solve it for you!

• ###### 6. Re: Summing an Aggregated Calculated Field

Hi Akram. I couldn't seem to get the formula to work. I'll post the workbook if that helps

1 of 1 people found this helpful
• ###### 7. Re: Summing an Aggregated Calculated Field

Hi

I'm using 10.1 version so could not able to open the workbook.