Tableau, cannot further aggregate
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.
Comments
-
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):
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 isArgument 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
andHistogram