Reputation: 45
I have three queries that each perform a SUM on my mssql database. I want all three of these SUM results visible at the same time in the same Grafana table, so I SELECT them AS 'cash' and have grafana perform an outer join on 'cash' to get them all into the same column.
What I want to do, is add another column to the grafana table called 'department' so I can put the department the figures are relevant to in the same row as the figures.
Below find an edited screenshot (my edits in red) showing more or less what I'd like to acomplish as an end result.
I've looked at the grafana docs and tried a rows to fields transformation (https://grafana.com/docs/grafana/latest/panels/reference-transformation-functions/) but that seems to need more than one field already in the table for it to work. I've also looked at the docs for the table visualisation (https://grafana.com/docs/grafana/latest/visualizations/table/) as well as the other visualisations to see if any would fit my needs.
Is what I want to do possible in grafana, or am I using the wrong features to try and achieve it?
Upvotes: 1
Views: 26428
Reputation: 234
I assume you try to build a Table in Grafana and aggregate the values. I did the same , but i could not have both table entries and at the end of the page the sum.
I made two panels :
1 x Panel with the tables entries
1 x Panel with the sum
You can get the sum with "Reduce" in Transformation tab.
good luck
Upvotes: 1
Reputation: 46
In case it helps someone, I was searching for a solution to this problem and I found it here: https://community.grafana.com/t/show-multiple-columns-on-grafana-table-plugin/35272/5
Transformations -> Outer Join
Upvotes: 2