Tableau, cannot further aggregate

10,901

If the calculated field has aggregation inside, Tableau doesn't let you aggregate it again. You may try using window aggregation such as window_Avg.

For example:

First Calculation: Profit Ratio

sum([profit])/sum([Sales]) //Aggregate Calc

Second Calc: Avg of Profit Ratio

window_avg([Profit Ratio]) //Table Calc

For more reference read this page.

Share:
10,901
Rhonda
Author by

Rhonda

I love you all!!!

Updated on July 27, 2022

Comments

  • Rhonda
    Rhonda almost 2 years

    Reading this tutorial on creating normal curve on Tableau

    I am trying to create Standard Deviation calculated field for Average Ratings of each Location (Average rating is written on heat map):

    enter image description here

    Creating the mean was easy, because I already have following:

    Mean = Total(AVG([Number_Rating]))
    

    And I can create standard deviation

    St Dev = TOTAL ( STDEV ( [Number_Rating] ) )
    

    But I have difficulty creating curve

    Curve = (1/(sqrt([St Dev]^2*2*pi()))) * exp(-( (attr([Rating Bin Size])-[Mean])^2  /  (2*[St Dev]^2)  )) 
    * [Rating Bin Size]
    * TOTAL(SUM([Occurrence_Location]))
    

    Occurrence_Location is the number of Locations, i.e. CountD([Location]). Error is

    Argument to SUM (an aggregate function) is already an aggregation, and cannot be further aggregated.
    

    How to fix this? Workbook on Public Tableau, tab of interest is Grade and Histogram