You’ve now mocked out that data and can fiddle with it. Then you can take it to the next step and link it to GoogleSheets or pull in CSV data using the CSV plugin, BigQuery, or others:
Thanks for this information. I’m wondering how I can do this with a MySQL query. Perhaps it’s just that I don’t have enough experience writing queries, but I don’t understand how to make thousands of records into a form similar to what’s shown above. It seems like I would have to pivot the results into column headers.
Thank you. Yes, that makes sense, but my series names are dynamic. I’d like to select client names as the category, tickets per technician name would be the series (I think).
So, using the CSV example originally posted, what I’d like to get is something like this:
SELECT COUNT(ticket_id), S.firstname AS Tech, O.name AS Client
FROM tickets T
JOIN staff S ON T.staff_id = S.staff_id
JOIN user U ON T.user_id = U.id
JOIN organization O ON U.org_id = O.id
GROUP BY Client, Tech
ORDER BY Client
I think I need to transform the query somehow and I’m just not experienced enough with SQL, I think.
Hey @bferdinandes, quick question: are there any other adjustments i have to make to get rid of the error of “bar chart requires a string field” besides adding AS string values for the query?
Here is my query:
SELECT
SUM(x.buying_price_per_unit * x.quantity) as “Revenue”,
count(y.id) AS “Sales”,
$__timeGroupAlias(created_date,1h)
FROM y
INNER JOIN x ON x.order_id = y.id
GROUP BY created_date
ORDER BY $__timeGroup(created_date,1h)SELECT