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

**URL:** <https://community.dynatrace.com/t/next-dql-question-challenge-how-to-transpose-like-in-excel/49547>\
**Category:** DQL\
**Tags:** dql\
**Created:** [January 2, 2025, 12:10pm UTC](https://community.dynatrace.com/t/next-dql-question-challenge-how-to-transpose-like-in-excel/49547 "2025-01-02T12:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [January 2, 2025, 12:10pm UTC](https://community.dynatrace.com/t/next-dql-question-challenge-how-to-transpose-like-in-excel/49547/1 "2025-01-02T12:10:49Z")

</div>

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](https://community.dynatrace.com/post/230638))

KR Henk

---

<div class="post-metadata">

**Author:** ![sia\_h](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sia\_h](https://community.dynatrace.com/u/sia_h)\
**Post date:** [January 2, 2025, 12:34pm UTC](https://community.dynatrace.com/t/next-dql-question-challenge-how-to-transpose-like-in-excel/49547/2 "2025-01-02T12:34:09Z")

</div>

Try this:

```markup
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)

```

---

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [January 2, 2025, 1:02pm UTC](https://community.dynatrace.com/t/next-dql-question-challenge-how-to-transpose-like-in-excel/49547/3 "2025-01-02T13:02:39Z")

</div>

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
