skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Average
 

Try Corticon Now

Average

SYNTAX

<Collection.attribute> ->avg

DESCRIPTION

Averages the values of all of the specified attributes in <Collection>. <Collection> must be expressed as a unique alias. <attribute> must be a numeric data type.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

This sample Rulesheet uses ->avg to average the integer1 values of all elements in collection2, then assigns the resulting value to decimal1 in Entity1. Note the use of the alias collection2 to represent the collection of Entity2 elements associated with Entity1.

SAMPLE RULETEST

A sample Ruletest provides integer1 values for three elements in collection2. The following illustration shows Input and Output panels: