About derived attribute functions

Derived attribute functions enable you to offload complex calculations involving multiple tuple attributes to custom Python scripts.

Use derived attribute functions when you need to execute complex business logic that standard engine computations can't handle efficiently. By passing tuple data to a dedicated Python function, the system calculates the result and returns the value to the engine.

A typical use case involves financial computations. For example, calculating a final transaction amount based on varying geographic tax rates and surcharges.

To implement a derived attribute function, administrators must configure two primary components:

  • Python Script: Contains the core logic to process the tuple attributes and return a double value.
  • JSON Definition: Defines the function signature, expected inputs, and variables so that the function is available in the Detect user interface.

Store back mechanism

The store back feature allows the system to save a computed value from a current processing event (a tuple) into a database. This ensures the value is remembered and can be retrieved when future tuples arrive for the same entity.

The system uses a key identifier (such as an audience key) to store the computed value into a designated column within a store back table.

For example, consider a scenario where you want to track customer information across different events:

  • A tuple arrives with audience ID 123.
  • The system calculates a value (for example, an updated transaction total of 456).
  • The store back function saves the value 456 in a designated column (for example, a zip code column) for audience ID 123 in the designated lookup table.
  • When a subsequent tuple arrives for audience ID 123, that saved value is available for retrieval.