Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Learn more about the statistical functions AVG (average), COUNT, MAX, MIN. 

Overview

FunctionDescription
AVG (for average)Determines the average (arithmetic mean)

Table of Contents
minLevel2

...

bgColorwhite

AVERAGE

Use this function to determine the average (arithmetic mean) of a list or collection.

The AVG function has two syntax forms: the collection form and the list form. You can use the collection form to determine the average value of all occurrences of an attribute. The list form is used to determine the average value of a set of different attributes.

Collection form syntax

Code Block
AVG ( attribute )
  • attribute - An attribute of any type of number or date of which multiple instances can occur at runtime.

List form syntax

Code Block
AVG ( [ value1 , value2 , ... ] )
  • [ value1 , value2 , … ] - A list of attributes, expressions or fixed values of any type of number or date. Use the square brackets to indicate that the arguments form a list of values.

Return types

  • number
  • integer
  • currency
  • percentage
  • date

The function returns UNKNOWN if one or more values are UNKNOWN.

Examples

Suppose the following domain model.

 

...

Residence.appraisalValue

Residence.askingPrice

Residence.mortgage

...

€ 140000

€ 150000

€ 142000

...

€ 132000

€ 139000

€ 137500

...

 

...

 

...

bgColorwhite

MIN

...

of a list or collection.

The MIN function has two syntax forms: the collection form and the list form. You can use the collection form to determine the minimum value of all occurrences of an attribute. The list form is used to determine the minimum value of a set of different attributes.

Collection form syntax

Code Block
MIN ( attribute )
  • attribute - An attribute of any type of number or date of which multiple instances can occur at runtime.

List form syntax

Code Block
MIN ( [ value1 , value2 , ... ] )
  • [ value1 , value2 , … ] - A list of attributes, expressions or fixed values of any type of number or date. Use the square brackets to indicate that the arguments form a list of values.

Examples

Suppose the following domain model.

 

...

Residence.appraisalValue

Residence.askingPrice

Residence.mortgage

...

€ 140000

€ 150000

€ 142000

...

€ 132000

€ 139000

€ 137500

...

COUNTRetrieves the number of instances for the specified entities or attributes. 
MAXDetermines

 

...

bgColorwhite

MAX

...

the maximum value of a list or collection.

The MAX function has two syntax forms: the collection form and the list form. You can use the collection form to determine the maximum value of all occurrences of an attribute. The list form is used to determine the maximum value of a set of different attributes.

Collection form syntax

Code Block
MAX ( attribute )
  • attribute - An attribute of any type of number or date of which multiple instances can occur at runtime.

List form syntax

Code Block
MAX ( [ value1 , value2 , ... ] )
  • [ value1 , value2 , … ] - A list of attributes, expressions or fixed values of any type of number or date. Use the square brackets to indicate that the arguments form a list of values.

Examples

Suppose the following domain model.

 

...

Residence.appraisalValue

Residence.askingPrice

Residence.mortgage

...

€ 140000

€ 150000

€ 142000

...

€ 132000

€ 139000

€ 137500

...

 

MINDetermines the minimum value of a list or collection.

Functions

Include Page
Statistical function AVG for average
Statistical function AVG for average


Include Page
Statistical function COUNT
Statistical function COUNT


Include Page
Statistical function MAX
Statistical function MAX


Include Page
Statistical function MIN
Statistical function MIN

...

bgColorwhite

...

Use this function to retrieve the number of instances for the specified entities or attributes. Please note the similar function SIZE.

Syntax

Code Block
COUNT ( collection )
  • collection - A collection of attribute or entity instances.

Return type

  • integer

Examples

Suppose the following data model.

 

...

 

...

 

UI Text Box
typenote

SIZE and COUNT are similar except for ?:

SIZE( ? ) results in 0, while COUNT( ? ) results in ?

...