Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

avg

avg

Returns the average of the values in the input sequence given in the argument, that is, the sum of the values divided by the number of values.

Syntax

fn:avg(arg)
The following table describes the argument for this command:
Argument
Required/Optional
Description
arg
Required
Numeric data type. Passes the values for which you want to calculate an average. You can enter any valid transformation expression.

Return Value

  • Numeric value.
  • NULL if all values passed to the function are NULL.

Examples

The following table lists some sample values and return values:
SAMPLE Function
OUTPUT
fn:avg( (1, 2, 3, 4, 5) )
3
fn:avg( (1, 2, 3, (), 4, 5) )
3
fn:avg( () )
()
The following expression returns the average wholesale cost of flashlights:
fn:avg( WHOLESALE_COST, ITEM_NAME='Flashlight' )
ITEM_NAME
WHOLESALE_COST
Flashlight
35.00
Navigation Compass
8.05
Regulator System
150.00
Flashlight
29.00
Depth/Pressure Gauge
88.00
Flashlight
31.00

Tip

You can perform arithmetic on the values passed to AVG before the function calculates the average. For example:
fn:avg( QTY * PRICE - DISCOUNT )

0 COMMENTS

We’d like to hear from you!