Create bar graph/pie chart from athena query in Grafana

Hello! I have an athena query that returns various strings denoting a service type. I am trying to display the different services with aggregate counts as a bar graph but the query only returns the strings. How do i create a bar chart with this info?

Example response: “abc”, “abc”, “xyz”, “pqr”, “abc”, “abc”, “pqr”

so ideally a bar chart that shows 4 for the value of abc and 2 for the value “pqr”.

Thanks!

So the data aend is comma delimited?

That is just an example but it will be a sql query that returns those values, and a table representation works fine, trying to do a bar graph or pie chart showing the count along with it

please share a query with sample data. That way we can try it on our database. otherwise it would just be guess work

Thank you ! I was able to play around with my query and got it working

from table_name 
where col_name = 'tag_to_display' UNION ALL
select count(col_name), 'tga_2_to_display
from table_name 


Thank you !
1 Like