For the complete documentation index, see llms.txt. This page is also available as Markdown.

Expert OTQL Builder

Write OTQL directly to define a segment, for when the builders cannot express what you need.

What it is

The Expert OTQL Builder leverages the query tool to create a segment from an OTQL query you write yourself. It asks the most of you and gives the most expressiveness in return.

It is also the User Expert Query entry you see when you click New Segment. That entry is not a segment type of its own - it is another way of producing a Query segment.

Reach it from Builders > Expert: OTQL, or from Data studio > Query Tool.

OTQL the language is documented in OTQL documentation. This page covers using it to build a segment.

Building a segment

1

Write the query

Follow the pattern SELECT {id} FROM UserPoint WHERE ....

Because you are creating a segment of users, the FROM clause always refers to UserPoint:

SELECT {id} FROM UserPoint WHERE creation_date >= "2019-12-12"
2

Run it

Run the query to confirm it is valid and returns results.

3

Save it as a segment

Click Save As > User Query Segment.

Counting before you save

To check the potential volume of the segment you are about to create, use the @count{} directive:

SELECT @count{} FROM UserPoint WHERE creation_date >= "2019-12-12"

Editing one afterwards

A segment created this way is edited as OTQL, in the dedicated zone of the segment page - not in a builder. See Query segment.

Last updated

Was this helpful?