Help with Grafana and SQL

We are using version 7.5.5 on Linux and connecting to SQL database.
I am trying to create a timeseries graph with multiple series.
The problem is the grouping: it is not calculating a month properly… is there anyway around it?
This is my query:
SELECT
$__timeGroup(Posting_Date,‘1M’) as time,
SUM(Mat_Costs_Confir) as value,
b.Machine_Family as metric
FROM
SAP_SCRAP_VAL a
INNER JOIN
SAP_SCRAP_VAL_GROUP b
ON
a.Prod_Supervisor = b.Prod_Supervisor
WHERE
$__timeFilter(Posting_Date) AND
b.Machine_Family IN ($parameter_Group)
GROUP BY
$__timeGroup(Posting_Date,‘1M’),
b.Machine_Family
ORDER BY
$__timeGroup(Posting_Date,‘1M’) ASC

And this is the result:

You can see the group is not a month exactly!!!

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