Count and Graph Occurrences Within Column

I’m very new to Grafana AND Mysql so I’ve been blindly Googling for a solution to no avail.

We want to count and bar graph the different unique values in the “Homebase_Name” column.

We are using a MySQL DB table below as the datasource.

±-------±-------±---------+
|Name | ID | Name_ID|
±-------±-------±---------+
| External | 15 | 3 |
| External | 16 | 3 |
| External | 17 | 3 |
| External | 18 | 3 |
| External | 19 | 3 |
| External | 20 | 3 |
| Internal | 21 | 1 |
| Internal | 22 | 1 |
| External | 23 | 3 |
| External | 24 | 3 |
| External | 25 | 3 |
| External | 26 | 3 |
| External | 27 | 3 |
| Internal | 28 | 1 |
| External | 29 | 3 |
| External | 30 | 3 |
| External | 31 | 3 |
| External | 32 | 3 |
±-------±-------±--------+

So I think I figured it out with some Google-Fu

I used the 2 queries below to count then graph the number of occurrences of a specified value in a specified column.

Query A
SELECT
NOW() AS “time”,
Name,COUNT(Name)
FROM TABLE NAME
WHERE Name = ‘External’

Query B
SELECT
NOW() AS “time”,
Name,COUNT(Name)
FROM TABLE NAME
WHERE Name = ‘Internal’

This topic was automatically closed after 365 days. New replies are no longer allowed.