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
  • Required skillset
  • Creating audience

Was this helpful?

  1. ENGAGE
  2. Audiences

Creating Audience Using SQL Builder

PreviousCampaign Event FiltersNextManaging Audiences

Last updated 7 days ago

Was this helpful?

Sometimes, the querying may be complex due to the nature of data modelling in the warehouse. Sortment allows you to create SQL based audiences directly.

It also enables Gen AI based flow where user can generate SQL queries using prompts, and improve them.

Required skillset

This requires a technical understanding of your data tables and SQL. With the AI generated query, a user review may be requried to validate the correctness. Data or analytics engineers are often involved.

Creating audience

  1. Go to Audiences page and click Create Audience. Switch to the SQL editor view.

  2. The SQL editor supports executing any SQL specific to your database or data warehouse.

  3. You can also generate a query from a prompt. This will use GPT-4 to generate an SQL query. Verify that the query logic is correct.

  4. You can preview audience data with count of your audience for the current SQL query.

  5. You can improve an SQL query using AI. This will take your text prompt and existing query as input to generate a new query.

  6. Save the query once you've verified the output. Ensure that user ids are part of your SQL query. Sortment will only access user data based on user ids. When saving an audience, you need to define which column in your SQL generated output has user ids. You can read more about saving and sync .

here