Grafana by month

  • What Grafana version and what operating system are you using?
    Latest version, its in remote server i believe linux connected using Postgre SQL
  • What are you trying to achieve?
    I’ve a table where I have following Columns
    -Year , -Budget , -Timestamp with y/m/d/t/m/s
    I’d like to create a graph that represents the Timestamps by months, in the x-axis
    January, February, March, April, etc.
    For each year when I select variable = Year, it should show the data based on months.
  • How are you trying to achieve it?
    Time series chart
  • What happened?
    Data not varying based on years.
  • What did you expect to happen?
    Time graph with X-axis Months as constant and y axis data changes based on variable year selection.

Could you please let me know how can i do it, if needed i can provide data

Thanks for the help

Hello @sunny0938b

what type of database is it? mysql, sql server, postgres?

@yosiasz its postgre SQL server

Hi @sunny0938b

Have you tried using a date truncate function, like this?

SELECT DATE_TRUNC('month', timestamp_column) AS month,
       COUNT(*) AS count
FROM your_table
GROUP BY month
ORDER BY month;

its not working for me. I have attached image of my data for more understanding.

I have attached Grafana dashboard with your command as well,

I want to have an output where Varible Year is selected (2022, 2023, 2024… etch) data should be shown with X-axis months (Jan, Feb, Mar etc) and Y-axis with Budget of that particular year only.

Thanks for the help.

What @grant2 has is what you need to use

Read the docu about that function he used

i used Plotly Plugin for this work. Thanks for the help.