A Calculated Attribute is a special type of People Attribute whose value is dynamically derived instead of being specified. The Calculated Attribute value holds the result of the calculation as it was last computed.
To create a Calculated Attribute, check calculated when defining the Attribute properties. The Calculation Rules tab and Variables tab are displayed within the People Attribute Details screen.
At a minimum, a Calculated Attributed is defined by the following:
A name
A data type
An expression for deriving the attribute value
A Time-to-Live (TTL) value that indicates how long the calculated value is considered valid before it can be re-calculated
A computation mode defining when the attribute value should be computed
The platform supports two different methods of refreshing the values in a Calculated Attributes. These methods (called "computation modes") are On-demand and Scheduled.
On-demand computation happens when some event or caller needs to display the value in the Calculated Attribute for an individual. This caller could be, for example, a mobile app, a website, an API call, or a user within the platform's interface.
When this call occurs, the platform checks the Time-to-Live value for the Calculated Attribute for the referenced Member. If the current time is beyond the TTL range, the platform will recalculate the value in the Calculated Attribute. Conversely, if the current time is still within the TTL range, the platform will simply show the existing "cached" value.
Scheduled computation occurs based on a Scheduled Job. A Scheduled Job executes at a designated frequency, and it will recalculate the values in the Calculated Attribute for every customer record in the database.
The features and options available from the Calculation Rules tab are described below.
Create a RuleRules allow you to define the conditions for which Person records will have the Calculated Attribute derived. To create a Rule:
Create Rule GroupsOptionally, you can organize Rule Conditions into a Rule Group. The Rule Group has its own AND / OR operator which allows you to define more complex, sophisticated Rules. To create a Rule Group:
Define ResultThe "Result" section is used to define the value that gets assigned to the Person records selected by a Rule. The platform supports several different methods of deriving the Result. Define Result: SimpleDefine Result: Simple Define Result: ExpressionDefine Result: Expression Define Result: BinningDefine Result: Binning Define Result: Activity AggregateDefine Result: Activity Aggregate |
To define a Calculated Attribute using a Groovy expression:
|
Back to People Attribute Details