Reputation: 297
There is some data:
A, B, C (where C = A/B)
10, 20, 0.5
10, 100, 0.1
There are two ways of counting the average C:
This is Tableau: sum([A])/sum([B])
This is in Tableau: No Idea...
Both have different usages. I need the second one, but can't find a way to calculate it. Anything I try, I always get the first type.
Upvotes: 1
Views: 925
Reputation: 580
You are correct. In your first method, tableau is calculating the calculated field C by summing values according to the dimensions you are partitioning on in your view.
In your second option, you need to tell tableau to calculate column C (or define a different column D) for every row of the data, no sums involved. Simply: [A]/[B].
Then when you AVG column C (or D) you will get the average of all A/B values, instead of SUM(A)/SUM(B). You can get the average of column D by using the built in tableau AVG function instead of doing it manually
Upvotes: 2