Docs
Sign up now
  • Getting started
    • Welcome to Sortment
    • Core Concepts
  • Schema
    • Overview
    • Related and Events Table
    • Setting Up Related Table
    • Setting Up Events Table
    • Custom Properties
  • ENGAGE
    • Audiences
      • Creating Audience
      • Audience Filters
      • Campaign Event Filters
      • Creating Audience Using SQL Builder
      • Managing Audiences
      • Audience Insights
    • Traits
      • Use Cases
      • Calculated Traits
        • Advanced Mode
      • Dynamic Traits
    • Profiles
      • User Profile View
    • Campaigns
      • Overview
      • Building a Campaign
      • Campaign Reports
        • Glossary
      • Conversion Tracking
  • Journeys
    • Getting Started
    • Journey Builder
    • Journey Components
      • Trigger
      • Delays
      • Flow Control
      • Action blocks
    • Tutorial: Creating a journey
    • Journey Settings
  • Connector
    • Overview
    • Getting started
      • Iterable
      • Klaviyo
  • Enable Data Sync
  • Setup
    • Data Warehouses
      • Snowflake
      • BigQuery
      • Redshift
      • Databricks
      • PostgreSQL
    • Cloud Bucket Storage
      • Amazon S3 for Snowflake
      • Google Cloud Storage for BigQuery
      • Amazon S3 for Redshift
      • Amazon S3 for Databricks
    • Communication Channels
      • Email
        • SendGrid
        • SES
        • Mailmodo
      • SMS
        • MSG91
        • Gupshup
      • WhatsApp
        • Meta (Facebook)
          • Add new Phone Number to Meta
        • Gupshup Enterprise
        • WATI
        • Gallabox
        • Yellow.ai
        • Kaleyra.io
    • Real-time Events
      • Setting up Event Source
      • Whitelist Event Payload
  • Settings
    • Sync Schedules
    • Audit Logs
    • Subscription Groups And Contact Fields
    • Delivery Controls
    • Test Profiles
    • Alerts
  • Data and Security
    • Technical Overview
    • Warehouse Data Practices
    • Data Access And Usage
    • Security Compliance
    • Audit Logs
    • Privacy Policy
Powered by GitBook
On this page
  • Creating a calculated trait using advanced mode
  • Open the traits section:
  • Step 1: Click “New Trait”
  • Step 2: Choose trait type
  • Step 3: Define trait settings
  • Step 4: Trait details:
  • Step 5: Define trait logic
  • Step 6: Finishing the trait

Was this helpful?

  1. ENGAGE
  2. Traits
  3. Calculated Traits

Advanced Mode

PreviousCalculated TraitsNextDynamic Traits

Last updated 24 days ago

Was this helpful?

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

  • 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 for a dimension trait:

SELECT
  account_id,
  CASE
    WHEN spend > 1000 THEN 'High Value'
    WHEN spend BETWEEN 500 AND 1000 THEN 'Medium Value'
    ELSE 'Low Value'
  END AS account_segment
FROM
  platform_accounts

Step 6: Finishing the trait

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

  2. Click finish to save the trait.

Trait type: Select or .

dimension
metric