
1. Re: Calculating the ratio of values within a dimension.
Bill Palombi Feb 19, 2014 1:14 AM (in response to Tyler Scheid)Tyler,
You were on the right track. The problem wasn't with the count measures, it was with the "Bud Break%" calculation.
I broke the calculation down for simplicity.
"NumberValueNotNull" replaces all Null values with 0: IFNULL([NumberValue], 0)
"Green Bud Count" isolates the green bud measures: IF [Item]='Green Buds' Then [NumberValueNotNull] end
"Dormant Bud Count" isolates the dormant bud measures: IF [Item]='Dormant Buds' Then [NumberValueNotNull] end
"Bud Break %" calculates the desired percentage: SUM([Green Bud Count])/(SUM([Green Bud Count])+SUM([Dormant Bud Count]))
The key is that you have to sum the variables top and bottom of the equation for Tableau to calculate the percentage correctly.
Bill

winegrape budbreak calc.twbx 245.1 KB


2. Re: Calculating the ratio of values within a dimension.
Tyler Scheid Feb 19, 2014 9:06 AM (in response to Bill Palombi)Bill,
Many thanks for the spot on answer! Your approach to handling the Null values is more simple/elegant as well.
Thanks,
Tyler