Skip to main content

Examples of how to use z-test functions

The z-test functions are used to find values associated with z-test statistical analysis for large data samples, usually greater than 30, and where the variance is known. This section describes how to build charts using sample data to find the values of the z-test functions available in QlikView. Please refer to the individual z-test chart function topics for descriptions of syntax and arguments.

Loading the sample data

The sample data used here is the same as that used in the t-test function examples. The sample data size would normally be considered too small for z-test analysis, but is sufficient for the purposes of illustrating the use of the different z-test functions in QlikView.

Do the following:

  1. Create a new document.
  2. Tip: If you created a document for the t-test functions, you could use that and create a new sheet for these functions.
  3. Select Edit Script in the toolbar and enter the following to the script:


    crosstable LOAD recno() as ID, * inline [





















    25|2 ] (delimiter is '|');

    In this load script, recno() is included because crosstable requires three arguments. So, recno() simply provides an extra argument, in this case an ID for each row. Without it, Comparison sample values would not be loaded.

  4. Save the script and click Reload to load the data.

Creating z-test chart function charts

Do the following:

  1. Add a straight table on the sheet and select Type as a dimension.

  2. Add the following expressions:

  3. Label Expression
    ZTest Conf ZTest_conf(Value)
    ZTest Dif ZTest_dif(Value)
    ZTest Sig ZTest_sig(Value)
    ZTest Sterr ZTest_sterr(Value)
    ZTest Z ZTest_z(Value)
Tip: You might wish to adjust the number formatting of the measures in order to see meaningful values. The table will be easier to read if you set number formatting on most of the expressions to fixed to 2 decimals. But for ZTest Sig, for example, use the number formatting: Number, and then adjust the format pattern to # ##.


The resulting table for the z-test functions for the sample data will contain the following values:

Type ZTest Conf ZTest Dif ZTest Sig ZTest Sterr ZTest Z
Comparison 6.40 11.95 0.000123 3.27 3.66
Value 5.48 27.15 0.001 2.80 9.71

Creating z-testw chart function charts

The z-testw functions are for use when the input data series occurs in weighted two-column format. The expressions require a value for the argument weight. The examples here use the value 2 throughout, but you could use an expression, which would define a value for weight for each observation.

Examples and results:  

Using the same sample data and number formatting as for the z-test functions, the resulting table for the z-testw functions will contain the following values:

Type ZTestw Conf ZTestw Dif ZTestw Sig ZTestw Sterr ZTestw Z
Comparison 3.53 2.95 5.27e-005 1.80 3.88
Value 2.97 34.25 0 4.52 20.49