13 May 2025
12:09 PM
- last edited on
14 May 2025
08:03 AM
by
MaciejNeumann
is it possible to transpose the values of the table in the dashboard?
13 May 2025 10:17 PM
Behind the scenes, each table row is a separate 'record'. In order to transpose, you'd have to likely perform some specific transformations in DQL. Happy to try and help you with that if you want to share your current DQL.
14 May 2025 11:32 AM
@marco_irmer thanks for your reply
I'm using browser monitoring metrics to be added as a table for a browser monitoring.
Table output is
15 May 2025 02:24 PM - edited 15 May 2025 02:25 PM
Hello,
I also had a similar usecase to transpose the table to have a better comparison for 2 records and was able to achieve it with some workaround.
Default working in DQL -
Below is a sample code of the table visualisation
data record(content="{\"host\":\"host1\",\"cpu\":\"67\",\"memory\":\"80%\"}"),
record(content="{\"host\":\"host2\",\"cpu\":\"33\",\"memory\":\"44%\"}")
| parse content,"json:jsonContent"
| fields host = jsonContent[host], cpu = jsonContent[cpu], memory = jsonContent[memory]
For example, I have taken cpu and memory fields but I had around 10 fields of comparison and wanted to transpose the table to have a better view of the data.
Workaround in DQL:
data record(content="{\"host\":\"host1\",\"cpu\":\"67\",\"memory\":\"80%\"}")
| parse content,"json:host1Content"
| fields host1Content, state = "true"
| fieldsAdd temp = lookup([
data record(content="{\"host\":\"host2\",\"cpu\":\"33\",\"memory\":\"44%\"}")
| parse content,"json:contentJson"
| fields contentJson, state = "true"
],
sourceField:state,
lookupField:state)
| fields host1Content, host2Content = temp[contentJson]
| fields array= array(
concat("cpu::",host1Content[cpu],"::",host2Content[cpu]),
concat("memory::",host1Content[memory],"::",host2Content[memory])
)
| expand array
| parse array,"LD:Host'::'LD:Host1'::'LD:Host2"
| fields Host, Host1, Host2
NOTE: The above workaround example works with only 2 records, so the dql fetch should be limited to return 1 record in the sample
I hope it can be used for your requirement as well
16 May 2025 06:30 AM
@kumaravel Thanks for your reply.
How can it be done on dashboard classic
16 May 2025 09:45 AM
I have not tried this use case in classic dashboard. Will share if I find a solution.