ansans
March 29, 2026, 9:13pm
1
I use Grafana v11.0.0
I want to display metrics in a table where:
Example of desired output:
location | probe_1 | probe_2
-------------|---------|--------
location_a | 10.5 | 12.3
location_b | 8.2 | 9.1
Additionally, each metric value should have a data link pointing to a probe-specific URL.
I use PostgreSQL and return data in long format:
location_a | probe_1 | 10.5 | probe_ref_url_a
location_a | probe_2 | 12.3 | probe_ref_url_b
location_b | probe_1 | 8.2 | probe_ref_url_c
location_b | probe_2 | 9.1 | probe_ref_url_d
The pivot (matrix) works correctly and I see in Table panel:
However, the probe_ref_url field disappears after the transformation, so I cannot use it for data links for numeric values.
ALthough, I expected to still be able to attach a data link per cell, using the corresponding probe_ref_url.
Is there a way to:
Keep dynamic columns (probes)
Use pivot (matrix-like view)
AND still have cell-level data links based on row-specific URLs?
Or is there a recommended pattern/workaround for this use case?
Please try this , i am implement your problem in localhost postgresq and try to solve using grafana transformation, hope it will work for you.
thanks
I would do this purely in postgres not using any grafana transform then you have more control
Or use sql expression to take the pivoted data and rejoin it to original table to get the url
@infofcc3 your solution does not seem to solve the issue as it does not include the url needed
ansans
March 30, 2026, 6:04pm
5
Doing the pivot purely in PostgreSQL does indeed give more control, especially for keeping additional fields like URLs. The main limitation I see there is that probes are dynamic, so it would require generating SQL (e.g. via variables or dynamic query construction), which is a bit less straightforward but probably the most robust approach.
The second suggestion (pivot β then rejoin with original data) is interesting. I was thinking about it, but the challenge is that after pivoting, each cell no longer has a direct mapping to a specific row (location + probe), so attaching the correct URL per cell becomes tricky.
1 Like
how would you like the final result to look like with the url given this pivoted data
location | probe_1 | probe_2
-------------|---------|--------
location_a | 10.5 | 12.3
location_b | 8.2 | 9.1
ansans
March 30, 2026, 8:32pm
7
In the final result I expect each cell value to have its own data link.
So for example:
So visually the table stays the same:
location | probe_1 | probe_2
-------------|---------|--------
location_a | 10.5 π | 12.3 π
location_b | 8.2 π | 9.1 π
But each individual cell has its own URL behind it.
1 Like
So data wise, not visual wise, what would the final query result look like
ansans
March 31, 2026, 10:32pm
9
Data-wise, I would expect each cell to still carry both the value and its corresponding URL.
Conceptually something like:
location | probe_1_value | probe_1_url | probe_2_value | probe_2_url
-------------|---------------|---------------|---------------|--------------
location_a | 10.5 | url_a | 12.3 | url_b
location_b | 8.2 | url_c | 9.1 | url_d
So instead of a single value per cell, each (location, probe) pair would have:
metric value
corresponding URL
1 Like
this is going to have to be done in postresql through some fancy dynamic query. you canβt do this in grafana via transforms.