Use live query

Creating a Smart Chart gives you the full flexibility to compute the chart values but it can be tedious to always depend on a developer to code each new chart. The Live Query feature allows you to create a chart using SQL directly in the browser.

We can type our SQL query to compute the chart values. The returned columns must be named key and value. If we put the character ? in our SQL query, it will automatically be replaced by the current record opened.

In the following example, we simply count the number of transactions per quarter.

SELECT DATE_TRUNC('quarter', created_at) AS key, COUNT(*) AS value
FROM transactions
WHERE beneficiary_company_id = ?
GROUP BY key;

This Setup Guide step is now completed 🎉