The SQL Runner can be accessed from the New —> Query using SQL Runner option in your navigation bar.
Once you’re in the SQL Runner, you’ll see four key components:
A list of tables in your data warehouse that Lightdash has access to (based on your data warehouse connection in Lightdash).
The schema of a selected table.
The SQL query builder.
The results from your latest SQL query.
To build a query in the SQL Runner, just write your query in the SQL query builder, then hit Run query to see the results.You can access your Query history from your session by clicking on the SQL Query history button beside Run query.
Once you’ve run your query, you can build a chart by clicking on the chart tab in the SQL Runner.The charts in the SQL Runner are built from the data that you generated in your query. The chart builder automatically aggregates the data from your query results using the aggregation type that you choose. Depending on the column type, the aggregation options are:
count (which is a distinct count and will ignore duplicates)
any (which will count and include duplicates)
sum
average
max
min
Once you’ve configured your chart, you can save it, add it to a space, and add it to a dashboard by hitting save chart.SQL runner charts on a dashbaord can be filtered in the UI. See the filter documentation for more information.