i’m trying to create calculated field in tableau, my query is below:
SUM(IF([Qtr]='2018-Q1' OR [Qtr]='2018-Q2' OR [Qtr]='2018-Q3' OR [Qtr]='2018-Q4') THEN FLOAT([Channel Mix]) END) / FLOAT([Revenue])
i’m getting error saying cannot mix agreegate and non agreegate comparison.
Final objective is to divide with revenue column .
Please help
Advertisement
Answer
It appears that your numerator is a sum (an aggregation) but your denominator is not. Try dividing by:
/ sum(FLOAT([Revenue]))