
1. Re: Filtering causes calculation values to disappear
Mavis Liu Jun 14, 2018 9:55 AM (in response to Jackson Forrest)Hi Jackon,
You have nulls in your field, so please use this instead for TotalAverage which includes the zn function:
AVG(ZN([CM1]))+AVG(ZN([CM2]))+
AVG(ZN([CM3]))+
AVG(ZN([CM4]))+
AVG(ZN([CM5]))+AVG(ZN([CM6]))+AVG(ZN([CM7]))+AVG(ZN([CM8]))
+AVG(ZN([CM9]))+AVG(ZN([CM10]))+AVG(ZN([CM11]))
this will work.
Thanks,
Mavis

2. Re: Filtering causes calculation values to disappear
Jackson Forrest Jun 14, 2018 11:11 AM (in response to Mavis Liu)Thanks for your help Mavis, although I am still having an issue with the data. My filters are now working with your calculation, but strangely the calculation is reporting the average of all wells selected instead of the summed averages. For instance, AVG(ZN([CM1]))+AVG(ZN([CM2])) is effectively reporting the average of all data for these 2 wells instead of taking the average of each well then adding them together like the formula suggests.

3. Re: Filtering causes calculation values to disappear
Mavis Liu Jun 14, 2018 11:42 PM (in response to Jackson Forrest)Hi Jackon,
Depends how you want the avg to be calculated, with the ZN included it converts all the nulls to 0s so will change the average.
If I do a find the ZN AVG or CM1 and CM2 I get:
0.0003391 and 0.001699 respectively. Adding these up gets me the total of 0.002038 which is correct when using the previous formula I gave you:
Thanks,
Mavis

4. Re: Filtering causes calculation values to disappear
Jackson Forrest Jun 15, 2018 8:52 AM (in response to Mavis Liu)Running the ZN function on the individual well calculations within the TotalAverage calculation was actually averaging across all other 10 wells NULL values (value of 0) for each individual well, giving me much lower numbers than I was expecting (as seen in your screenshot). Interesting that Tableau was doing this although I do not have any null values in my raw data. I was able to make the averages run on just the desired well data by editing the formulas for each well calculation like this: ZN(AVG(IF [Well]='CM...' THEN [RESULT] END)). I then just did a simple addition calc for TotalAverage like [CM1]+[CM2]+[CM3]... This works fine. I will mark your first response as the correct answer as this was the solution to my initial problem of the filters not working.
Thanks again!