
1. Re: Help with Calculated Field  Only want to see results greater than zero
Deborah wilson Mar 8, 2013 3:16 PM (in response to Deborah wilson)And the issue is not the value for the production, it's that there are no entries for some of the wells. Looks like it may involve ISNULL somehow but I'm uncertain at this point and would appreciate some insight.
Thanks,

2. Re: Help with Calculated Field  Only want to see results greater than zero
Dan Huff Mar 8, 2013 4:48 PM (in response to Deborah wilson)Deborah
Have you tried the following:
IF ZN(SUM([OIL]*1000)/SUM([GAS]))>0
THEN ZN(SUM([OIL]*1000)/SUM([GAS]))
ELSE zn(SUM([OIL]))
END
When you have the ZNs next to the field rather than wrapping the aggregation, we are only going to apply the ZN logic to each row of the dataset. Then, Tableau will try and compute the ratio. Due to the zn being where you had it, it was likely causing some of the denominators to be 0s. This will cause Tableau to return NULL as the value for the ratio.
Wrapping the whole ratio in ZN will allow us to check whether the ratio itself is null. If the ratio returns a Null (due to a missing or 0 denominator) we will catch this with ZN and turn it into zero. In this case, it will not be greater than 0 so we will return zn(sum(Oil)).
Hope this helps,
Dan