
1. Re: Conditional Formula
Tom W Aug 16, 2016 8:06 AM (in response to Ben Adam)Hi Ben,
You need to wrap the calculation in the aggregate.
I.e.
SUM(IF [FieldA] = "x" then [FieldB] / [FieldC]))

2. Re: Conditional Formula
Ben Adam Aug 16, 2016 8:27 AM (in response to Tom W)Thanks for that Tom ... problem figures the calculation is returning don't seem correct.
Just in case I haven't explained this clearly ... for every value that equals "x" in [FieldA], I want the formula to sum [FieldB] and divide it by the sum of [FieldC]
Is that what the above should do?
Thanks
Ben

3. Re: Conditional Formula
Tom W Aug 16, 2016 9:41 AM (in response to Ben Adam)I can't really say with any certainty without seeing some sample data. Perhaps a level of detail calculation like {Fixed [Field A]: SUM([FieldB])/SUM([FieldC])} would work better as it would force the aggregation.
Please upload a Tableau Packaged Workbook including sample data.

4. Re: Conditional Formula
Benjamin Greene Aug 16, 2016 11:20 AM (in response to Ben Adam)You could try IF ATTR([Field A]) = "x" THEN SUM([Field B])/SUM([Field C]) END

5. Re: Conditional Formula
Andrew Watson Aug 16, 2016 11:41 AM (in response to Ben Adam)This should work: SUM(IF [FieldA] = 'x' THEN [FieldB] END)/SUM(IF [FieldA] = 'x' THEN [FieldC] END)

6. Re: Conditional Formula
Ben Adam Aug 17, 2016 12:53 AM (in response to Andrew Watson)Andrew, that seems to work. Cheers!