Scripting

Define custom analytics with declarative expressions

Objective

Joule core provides the ability to deploy declarative expressions using the custom analytics processor.

This has been reused within the context of feature engineering to enable users to define custom calculations within the DSL.

Example

The example demonstrates per-event calculation of a spend_ratio using a JavaScript-based expression, where users can define variables, such as avg_spend to customise the calculation.

feature engineering:
  ...
  features:
    compute:
      spend_ratio:
        scripting:
          macro:
            expression: 1 - spend/avg_spend
            variables:
              avg_spend: 133.78

Attributes schema

Last updated