Display record-specific charts in Analytics

Creating a Chart on a specific record

Having overall KPIs displayed on your dashboard is great, but sometimes you might need to get analytics on a specific user, item, etc. You can do that by adding a chart right inside a record.

These charts are created the same way you would do it in dashboard tab. Here's the step-by-step guide:

Token

What is different, though, is that when creating a chart on a specific record using SQL, you would have to enter this record's token. Identifying a token is pretty easy - it's the last digits of your hash in the address bar. Copy the digits and select the character Token to inject the current record to your query.

Token в Simple

Перейдите в Simple -> нажмите '+ Add Filter', из списка из Value выберите Token.

Token в SQL

Перейдите в SQL -> Для выбора Token нажмите на кнопку Token и выберите нужный параметр

An example

select
date_trunc('month', start) AS gr,
sum(amount)
from
ride
left join
transaction
on
ride.transaction_id=transaction.id
where
ride.vehicle_id={{model.id}}
group by gr
order by gr;