Concepts
Last updated
Was this helpful?
Last updated
Was this helpful?
Computed fields are defined in the schema at the UserPoint level.
The plugin behind it performs computations on a regular basis of a function's result, based on the user activities and profile updates.
A computed field is an instance of a Datamart function applied within a specific context. To use it, it must be declared in your schema.
A Computed Field Function is a of type COMPUTED_FIELD_FUNCTION
, which can be created via the API following the standard or through the computing console interface.
A computed field is defined by these elements:
State: The data stored to build the result. It is the history. Each new activity updates the State.
→ the state is closely related to the Lookback Window - i.e. the historical depth of events to be analyzed.
Logic: The logic can be very simple (like a formula, a sum, a count…) or more complex (like a logical operation).
Result: The data calculated and stored. It contains the score(s) to be used.
The result can be either a single variable or an object, depending on the complexity of the computation. It is computed from the State
Other interesting concepts to take into consideration:
Input Data: Either new userActivities, either userProfile update, either both.
Period Update: The regularity of updates (every x days - by default x=1).
INITIAL – The instance is created with this status.
INITIAL_LOADING – Once declared in the schema and successfully validated, an initial loading job is triggered.
ACTIVE – The computed field becomes active if the job is completed successfully.
To better understand how a computed field works, here are the technical steps and the relation with the methods:
Initialization: The computed field is declared in the schema.
State Updates: Triggered by new user activities or profile updates.
Result Calculation: The result is computed based on the current state.
Storage: The result is stored for querying.