Advanced Mode

Sortment’s Advanced Mode empowers data-savvy users to define custom traits using either a visual expression builder or SQL logic, depending on the trait type. This functionality allows you to create powerful, structured metrics and dimensions that go beyond natural language-based AI prompts.

💡 Tip: For most users, AI-based trait creation is sufficient. Use Advanced Mode when you wish to define traits manually.

Creating a calculated trait using advanced mode

Sortment provides an Advanced option to create calculated traits

Open the traits section:

  1. Click the star-shaped icon () in the left or top navigation bar.

  2. This opens the Traits page, where you can view, manage, and create new traits.

Step 1: Click “New Trait”

Start by clicking the “+ New Trait” button at the top right of the Traits page. Choose calculated traits.

Step 2: Choose trait type

Select "Advanced Mode" as the creation method

Step 3: Define trait settings

  • Trait type: Select dimension or metric.

  • Data source: Choose the relevant table (Eg., Users, Accounts)

Step 4: Trait details:

You'll be presented with the new calculated trait screen, enter:

  1. Trait Name : Enter descriptive name of the trait (e.g., Max Premium Ridefare)

  2. Description (Optional): Provide additional context or purpose of the trait. (e.g., Highest fare a user has paid in a ride)

  3. Tags (Optional): Add relevant tags to categorise or identify the trait.

Step 5: Define trait logic

Metric traits (Visual builder - No code) Use the dropdown-based builder to define logic without SQL:

  1. Property : Select the property from the dropdown (e.g, Ridefare)

  2. Function : Choose the aggregate function (e.g., Max ).

  3. Filter (Optional): Add filters to restrict the data in the calculation (e.g., Ride Type = Premium)

Dimension traits (SQL Editor) Use SQL logic to create more advanced or real-time traits.

Example syntax for a dimension trait:

CASE
    WHEN spend > 1000 THEN 'High Value'
    WHEN spend BETWEEN 500 AND 1000 THEN 'Medium Value'
    ELSE 'Low Value'
END AS account_segment

Step 6: Finishing the trait

  1. Use the preview results button to verify the output.

  2. Click finish to save the trait.

Last updated

Was this helpful?