Creating Audience Using SQL Builder
Last updated
Last updated
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.
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.
Go to Audiences page and click + Create Audience. Switch to the SQL editor view.
The SQL editor can execute whatever SQL is native to your warehouse or database.
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.
You can preview audience data with count of your audience for the current SQL query.
You can improve an SQL query using AI. This will take your text prompt and existing query as input to generate a new query.
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.