Hi @shubham2712 ,
you might be able to achieve what you want, but it probably depends on the details of your situation. For instance: what is your datasource and what are you trying to achieve?
I would read these two related topics and see if they help you transform your data how you’d like:
Grafana is able to produce graphs out of a single query with result set such as rows of times and value, in order to have another graph we can add a second query on the same graph like:
q1) SELECT time, value FROM test WHERE series_name = ‘A’;
q2) SELECT time, value FROM test WHERE series_name = ‘B’;
the issue is that in some cases we don’t know in advance the name of series and most of all how many series we have, the ideal would be to do:
SELECT time, series_name, value FROM test;
and t…
Found a way to do the Pivot in SQL:
SELECT User,
ROUND(SUM(IF(Month = 'January', Profit, NULL)),2) AS Jan,
ROUND(SUM(IF(Month = 'February', Profit, NULL)),2) AS Feb,
ROUND(SUM(IF(Month = 'March', Profit, NULL)),2) AS Mar,
ROUND(SUM(IF(Month = 'April', Profit, NULL)),2) AS Apr,
ROUND(SUM(IF(Month = 'May', Profit, NULL)),2) AS May,
ROUND(SUM(IF(Month = 'June', Profit, NULL)),2) AS Jun,
ROUND(SUM(IF(Month = 'July', Profit, NULL)),2) AS Jul,
ROUND(SUM(IF(Month = 'August', Profit, NULL)),2) AS Aug,…
~m