Hello Everyone,
I have a simple calculated field, by default tableau is making it attribute. However it want it to measure. please suggest.
IF [Actual] >= AVG[Target] THEN 1 ELSE 0 END
Please Note : [Actual] is already an aggregate which is sum[ numerator ] / sum[denominator]
Please suggest.
1 risposta
Hi Ravi,
If you remove the aggregations from the calculation, then you can aggregate it after the fact.
if [numerator] / [denominator] >= [Target] then 1 else 0 end
You can then sum, average, or any other aggregation on this after.
Otherwise, an option for aggregating an already aggregated field is to use a window calculation. Check out the calculations in here that start with the word "Window":
Table Calculation Functions - Tableau
Best,
Paul