4 Replies Latest reply on Aug 8, 2018 11:29 PM by Anshul Sharma

# Stat test in Tableau

Hi ,

i was trying to implement stat testing in tableau by referring to this article https://www.datarevelations.com/showing-now-versus-then.html.https://www.datarevelations.com/showing-now-versus-then.html

In the attached workbook, have a look at sheet2 calculation 3, this field just adds the two denominator which are already present on the canvas "Denom for current quarter" and "Denom for prevous quarter". For some reason the the calculated field is not showing anything.

i have tried many things but this field doesn't seem to work. individual values for both the fields is present but the moment i add them nothing shows up, maybe it has something to do with the data structure. please suggest.

• ###### 1. Re: Stat test in Tableau

Hi, Anshul

Is it something like this?

Hope this helps

ZZ

• ###### 2. Re: Stat test in Tableau

Hi ZZ,

thanks, it works but can you please explain why simple addition was not working for calculation 3 whereas subtraction was working fine for the Z Test Numerator.

• ###### 3. Re: Stat test in Tableau

Hi, Anshul

The reason is at row level, when it is identified as current quarter, it can be previous quarter as well, so previous quarter in this row will be null. but you just need the aggregation, so I add zn() to convert null to 0.

Hope this make sense

ZZ

• ###### 4. Re: Stat test in Tableau

calculation3 is working fine by using ZN() but the final goal of calculating the Ztest value is still not accomplished.

the "Z Test value" is still not showing anything and if I use ZN(Z test Value) it returns zero.

i tried calculating the Sqrt(calculation 3) first, which again is giving me unexpected results, Sqrt(6.3) is giving 3.5 as a result which is wrong.

can you tell me what is wrong with the calculations.