cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

is it possible to transpose the values of the table in the dashboard?

Arunkumarbnp
Helper

is it possible to transpose the values of the table in the dashboard?

5 REPLIES 5

marco_irmer
Champion

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.

@marco_irmer thanks for your reply

I'm using browser monitoring metrics to be added as a table for a browser monitoring.

 

 

Arunkumarbnp_0-1747218676010.png

Table output is 

Arunkumarbnp_1-1747218718289.png

 

 

kumaravel
Participant

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]

kumaravel_0-1747314906137.png

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

kumaravel_1-1747315274049.png

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

Dynatrace Certified Associate

@kumaravel Thanks for your reply.

How can it be done on dashboard classic

I have not tried this use case in classic dashboard. Will share if I find a solution.

Dynatrace Certified Associate

Featured Posts