## Wednesday, April 24, 2013

### Conducting 1 and 2-sample Z Tests in Tableau (NEW AND IMPROVED)

In a previous post, Conducting a 2-sample Z Test in Tableau, we gave a rudimentary way to conduct a 2-sample Z Test in Tableau.  Today, we will talk about a more concrete way for performing these both 1 and 2-sample Z Tests.  Due to the complexity of creating the workbook, we will not be walking you through the creation.  Instead, we will post the .twbx and show you how to use it.  As usual, we will use the Superstore Sales sample data set in Tableau.

The packaged workbook can be found here.  A major advantage to using this approach is that you can use any Excel file, regardless of the grain or dimensions of the data.  Tableau will do any and all slicing and aggregations for you.

There are two things you must have though.  First, the data must be stored in an Excel file.  Second, the grain and slicer you would like to use must each exist as a single field in the workbook.  If your slicer/grain is complex, you are free to create any calculated fields and/or groups, then use these in the calculations.

Step 1:
• Open the workbook
 Initial Workbook
Step 2:
• Right-Click the Data Source -> Select "Edit Connection"
• Connect to your Excel Workbook
 Connecting to the Excel Workbook
Step 3:
• Select the values and aggregations you would like to use in the test
 Value
Step 4:
• Select the grain you would like your values aggregated up to
 Grain
Step 5:
• Select the dimension/field/group you would like to slice your data with
 Slicer
Step 6:
• Select 1 slice to conduct a 1-sample test, comparing the slice against the [Theoretical Mean] Parameter
• Select 2 slices to conduct a 2-sample test, comparing the slices against each other
 Outcome
That's it!!! You've conducted a Z test in a matter of seconds.  You can easily group your data differently and conduct it again, if need be.  Since this is completely unproven ground, we will now appeal to you guys, the readers.  If you attempt to use this workbook, and run into any problems with things not working right, you wish it did something a little different, whatever.  LET US KNOW!!!  We want to make this great and we need your help.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn