inputavg

inputavg() returns the aggregated average of inputfield iterated over the chart dimension(s). inputfield must be a field name of a field properly declared as an input field in the script.

Syntax:  

inputavg(inputfield [, distribution_mode][set_expression])

When this aggregation function is used as expression in a table chart, it will be possible to edit the aggregated value interactively. When hovering over the expression cell you will see an input icon. Clicking on the icon sets the cell in input edit mode. It is possible to use up/down arrow keys to move between cells while staying in input edit mode. The change in the aggregated value will be distributed to the underlying field values using the chosen distribution_mode. The entire QlikView document will automatically recalculate whenever new values are entered.

The distribution_mode parameter can have the following values:

Parameter Description
'+' Default mode. Equal parts of the change are distributed to all the underlying values.
'*' The change is distributed proportionally (to existing values) to the underlying values.
'=' The value entered is given to all the underlying values.
'/'

The value is divided equally between underlying values, without regard to previous distribution but keeping previous average.

The distribution_mode values in the previous table can be amended with the following modifiers:

Modifier Description
T E.g. '+T'. Will cause a compensation of the entered change over the other selected values in the input field (keeping the grand total intact).
A E.g. '+A'. Will cause a compensation of the entered change over all other values (keeping the grand total intact).

Examples:  

inputavg (Budget )

inputavg (Budget, '+' )

inputavg (Budget, '*' )

inputavg (Budget, '=' )

inputavg (Budget, '/' )

inputavg (Budget, '+T' )

inputavg (Budget, '+A' )

 

See also:

 

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?