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

Next DQL question/challenge: how to transpose, like in excel(-;

henk_stobbe
DynaMight Leader
DynaMight Leader

Happy new year all!1

How do I get from

rec1 value1

rec1 value2

rec2 value3

rec2 value4

to:

rec1 value1 value2

rec2 value3 value4

I have read, but did not quite understand }-;

(Solved: DQL/DPL Transposing Arrays into lines? - Dynatrace Community

KR Henk

2 REPLIES 2

sia_h
Dynatrace Champion
Dynatrace Champion

Try this:

data record(timestamp = 1, location = "Vienna", bookings = 1254),
     record(timestamp = 1, location = "London", bookings = 4564),
     record(timestamp = 2, location = "Vienna", bookings = 1457),
     record(timestamp = 2, location = "London", bookings = 8741),
     record(timestamp = 3, location = "Vienna", bookings = 1654)
| summarize by: timestamp, collectDistinct(location), collectDistinct(bookings)

 

Cool thanks Sia,

To make your answer even more simple:

data record(rec = 1, value =1 ),

         record(rec = 1, value =2 ),

          record(rec = 2, value =3 ),

         record(rec = 2, value =4 )
| summarize by: rec, collectDistinct(value)

KR Henk

 

Featured Posts