I'm using aggregate SQL code to pull in my results, including a calculated percentage field. For example (F = field), F2/F1 = F3%.
This works for fine for each line item. However, the Subtotal and Total lines will SUM F2 and SUM F1, which is fine, but also SUM F3% which is not the desired result. Subtotal and Total for F3 should be calculated (SUM F2)/(SUM F1).
Please help in using either Tableau to change this Subtotal and Total calculation or in SQL (2005) code.
Hi Michelle,
Remove the F3 calculation from SQL aggregate query and create a calculated field in Tableau as F3=Sum(F2)/Sum(F1).