Statistical functions are used for calculating the distribution of a given set of values.

This article will cover the basic principles of working with these functions in the data load editor, including:

  • The general function syntax
  • Working with statistical functions in the data load editor

For a complete, up-to-date list of statistical functions, please see the Qlik Sense help pages here.

Note that statistical functions can also be used in visualisations using the same syntax.

The statistical function syntax

The general function syntax varies depending on the function. In this section, we will use an example function and decipher its syntax. This understanding will then help you read the syntax of other functions.

Example: NormDist

The NormDist() function returns the normal distribution for the mean and standard deviation given.

NORMDIST(value, [mean], [standard_dev], [cumulative])

The rules for reading the function syntax are as follows:

  1. The function name itself is first and all the parameters you need to enter go between brackets: ().
  2. The various elements you will need to enter are separated by commas. In this function, the elements are value, [mean], [standard_dev] and [cumulative].
  3. Anything between square brackets [] is an optional parameter. In this function, there are three optional parameters. The [mean] parameter allows you to specify the mean of the distribution (if omitted, 0 is assumed); the [standard_dev] parameter allows you to specify the standard deviation of the distribution (if omitted, 1 is assumed); the [cumulative] parameter allows you to use standard normal distribution (use 0) or cumulative normal distribution (use 1). The cumulative is assumed if the parameter is omitted. If optional parameters are included, you DO NOT write the square brackets around them.

An example of this function being used with the optional parameters included would be:

The resulting field would return a normal distribution given the values entered.

How to use statistical functions in the data load editor

Here are some important points on using statistical functions in the data load editor:

  • All of the functions can be used throughout the whole load script, not just within a LOAD or SELECT statement
  • The functions can be nested and combined with other types of functions
  • The functions are particularly useful for more complex statistical apps/ calculations than the more common reporting applications