## On this page

- Working with QlikView
- Script syntax and chart functions
- Functions in scripts and chart expressions
- Aggregation functions
- Statistical aggregation functions

#
Statistical aggregation functions

## Statistical aggregation functions in the load script

The following statistical aggregation functions can be used in scripts.

Avg() finds the average value of the aggregated data in the expression over a number of records as defined by a group by clause.

Correl() returns
the aggregated correlation coefficient for a series of coordinates represented
by paired numbers in

**correl**(x-expression, y-expression)

Fractile() finds the value that corresponds to the fractile (quantile) of the aggregated data in the expression over a number of records as defined by a group by clause.

**fractile**(expression, fractile)

Kurtosis() returns the kurtosis of the data in the expression over a number of records as defined by a group by clause.

LINEST_B() returns
the aggregated b value (y-intercept) of a linear regression defined by
the equation

**linest_b**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_DF() returns
the aggregated degrees of freedom of a linear regression defined by the
equation

**linest_df**(y-expression, x-expression [, y0 [, x0 ]])

This script function returns
the aggregated

**linest_f**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_M() returns
the aggregated m value (slope) of a linear regression defined by the equation

**linest_m**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_R2() returns
the aggregated

**linest_r2**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SEB() returns
the aggregated standard error of the

**linest_seb**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SEM() returns
the aggregated standard error of the

**linest_sem**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SEY() returns
the aggregated standard error of the

**linest_sey**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SSREG() returns the
aggregated regression sum of squares of a linear regression defined by
the equation

**linest_ssreg**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SSRESID() returns
the aggregated residual sum of squares of a linear regression defined
by the equation

**linest_ssresid**(y-expression, x-expression [, y0 [, x0 ]])

Median() returns the aggregated median of the values in the expression over a number of records as defined by a group by clause.

**median**(expression)

Skew() returns the skewness of expression over a number of records as defined by a group by clause.

Stdev() returns the standard deviation of the values given by the expression over a number of records as defined by a group by clause.

Sterr() returns
the aggregated standard error (

STEYX() returns
the aggregated standard error of the predicted y-value for each x-value
in the regression for a series of coordinates represented by paired numbers
in

**steyx**(y-expression, x-expression)

## Statistical aggregation functions in chart expressions

The following statistical aggregation functions can be used in charts.

Avg() returns the aggregated average of the expression or field iterated over the chart dimensions.

**avg**([{SetExpression}] [DISTINCT] [TOTAL [<fld{, fld}>]] expr)

Correl() returns the aggregated correlation coefficient for two data sets. The correlation function is a measure of the relationship between the data sets and is aggregated for (x,y) value pairs iterated over the chart dimensions.

**correl**([{SetExpression}] [TOTAL [<fld {, fld}>]] value1, value2 )

Fractile() finds the value that corresponds to the fractile (quantile) of the aggregated data in the range given by the expression iterated over the chart dimensions.

**fractile**([{SetExpression}] [TOTAL [<fld {, fld}>]] expr, fraction)

Kurtosis() finds the kurtosis of the range of data aggregated in the expression or field iterated over the chart dimensions.

**kurtosis**([{SetExpression}] [DISTINCT] [TOTAL [<fld{, fld}>]] expr)

LINEST_B() returns the
aggregated

**linest_b**([{SetExpression}] [TOTAL [<fld{ ,fld}>]] y_value, x_value[, y0_const[, x0_const]])

LINEST_DF() returns the
aggregated degrees of freedom of a linear regression defined by the equation

**linest_df**([{SetExpression}] [TOTAL [<fld{, fld}>]] y_value, x_value [, y0_const [, x0_const]])

LINEST_F() returns the
aggregated F statistic

**linest_f**([{SetExpression}] [TOTAL[<fld{, fld}>]] y_value, x_value [, y0_const [, x0_const]])

LINEST_M() returns the
aggregated

**linest_m**([{SetExpression}] [TOTAL[<fld{, fld}>]] y_value, x_value [, y0_const [, x0_const]])

LINEST_R2() returns the
aggregated

**linest_r2**([{SetExpression}] [TOTAL [<fld{ ,fld}>]] y_value, x_value[, y0_const[, x0_const]])

LINEST_SEB() returns the
aggregated standard error of the

**linest_seb**([{SetExpression}] [TOTAL [<fld{ ,fld}>]] y_value, x_value[, y0_const[, x0_const]])

LINEST_SEM() returns the
aggregated standard error of the

**linest_sem**([{set_expression}][ distinct ] [total [<fld {,fld}>] ] y-expression,
x-expression [, y0 [, x0 ]] )

LINEST_SEY() returns the
aggregated standard error of the

**linest_sey**([{SetExpression}] [TOTAL [<fld{ ,fld}>]] y_value, x_value[, y0_const[, x0_const]])

LINEST_SSREG() returns the
aggregated regression sum of squares of a linear regression defined by the equation

**linest_ssreg**([{SetExpression}] [TOTAL [<fld{ ,fld}>]] y_value, x_value[, y0_const[, x0_const]])

LINEST_SSRESID() returns the
aggregated residual sum of squares of a linear regression defined by the
equation

**linest_ssresid**([{SetExpression}] [TOTAL [<fld{ ,fld}>]] y_value, x_value[, y0_const[, x0_const]])

Median() returns the median value of the range of values aggregated in the expression iterated over the chart dimensions.

**median**([{SetExpression}] [TOTAL [<fld{, fld}>]] expr)

Skew() returns the aggregated skewness of the expression or field iterated over the chart dimensions.

**skew**([{SetExpression}] [DISTINCT] [TOTAL [<fld{ ,fld}>]] expr)

Stdev() finds the standard deviation of the range of data aggregated in the expression or field iterated over the chart dimensions.

**stdev**([{SetExpression}] [DISTINCT] [TOTAL [<fld{, fld}>]] expr)

Sterr() finds the value of the standard error of the mean,

**sterr**([{SetExpression}] [DISTINCT] [TOTAL[<fld{, fld}>]] expr)

STEYX() returns the
aggregated standard error when predicting

**steyx**([{SetExpression}] [TOTAL [<fld{, fld}>]] y_value, x_value)