
1. Re: How do I calculate a ratio of two different domains within a field?
Shawn Wallwork Feb 21, 2013 12:21 PM (in response to Andreas Linden)(IF [Product]="Mac" THEN SUM([revenue]) END) / (IF [Product]="PC" THEN SUM([revenue]) END)

2. Re: How do I calculate a ratio of two different domains within a field?
Tracy Rodgers Feb 21, 2013 5:41 PM (in response to Andreas Linden)Hi Andreas,
Shawn is right, however, you might have difficulty in getting the measure to populate.
Therefore, separate the two clauses into 2 separate calculated fields:
Mac Revenue:
(IF [Product]="Mac" THEN ([revenue]) END)
PC Revenue:
(IF [Product]="PC" THEN ([revenue]) END)
Then, create a third calculation to find the ratio:
sum([Mac Revenue])/sum([PC Revenue])
Hope this helps!
Tracy

3. Re: How do I calculate a ratio of two different domains within a field?
Andreas Linden Feb 26, 2013 2:05 AM (in response to Tracy Rodgers)Thanks Tracy, Shawn! I can't seem to make the final calculation work though  the ratios all end up as null! It appears that, for each product/month calculation, Tableau either calculates a PC revenue or a Mac revenue, and sets one of the two to null  which is fine when summing the revenues of one of the products, but makes it difficult to calculate a ratio using these calculated fields.