Part 1: Open the Explorer
1
Open the SQL tab
Click Explorer in the left navigation, then click Data. The SQL tab opens.
2
Load an example
Click Examples (or load an example) and pick a query. It goes into the query box.
3
Run the query
Change the query and click Run query. The results show below as a table.
raw_events. Each row is one event. For session counts, read the table sessions (one row for each session of the date range; see Explorer). Read fields in context and properties with JSONExtractString() or JSONExtractFloat(). See the data catalog for every column.
Part 2: Useful queries
Top custom events in the date range{{date_from}} and {{date_to}} follow the date range in the page header. Use both or neither.
Part 3: Know the limits
- Write one
SELECTorWITHstatement, without comments. Onlyraw_events,sessions,session_eventsand your own subqueries are allowed. - A result has at most 200 rows. A query stops after 8 seconds.
- You can run 10 queries a minute, and a project can run 30.
raw_eventsincludes bot rows. Exclude them withJSONExtractString(context, 'device') != 'bot'.- Use
uniqExact(message_id)for exact event counts, because a client retry can repeat a row.
Part 4: Save a query as a chart
The Explorer does not save queries. To keep one, open a dashboard, click Add chart, click Blank chart, paste the query into the SQL query box, name the columns to draw, and click Save Chart. See How to build a custom dashboard.Related
- Explorer: the full rules and limits.
- Data catalog
- How to use Ask AI: get a chart without writing SQL.