# DQL table entity tags

**URL:** <https://community.dynatrace.com/t/dql-table-entity-tags/51423>\
**Category:** DQL\
**Tags:** dql, notebooks, dpl\
**Created:** [April 29, 2025, 3:27pm UTC](https://community.dynatrace.com/t/dql-table-entity-tags/51423 "2025-04-29T15:27:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [April 29, 2025, 3:27pm UTC](https://community.dynatrace.com/t/dql-table-entity-tags/51423/1 "2025-04-29T15:27:55Z")

</div>

Hi,

I would like to create a table with tags to an entity, for example, “dt.entity.sql:com\_dynatrace\_extension\_sql-oracle\_host”.

```markup
fetch `dt.entity.sql:com_dynatrace_extension_sql-oracle_host`
| fieldsAdd tags

```

Before query shows all tags combined as “field1:value,field2:value”… Those value are not ordered and not all rows contains same values.

Any option to adding those tags as as new fields/columns?

Best regards

---

<div class="post-metadata">

**Author:** ![Akhil-Jayendran](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/akhil-jayendran/32/153_2.png) [@Akhil-Jayendran](https://community.dynatrace.com/u/Akhil-Jayendran)\
**Post date:** [April 29, 2025, 3:52pm UTC](https://community.dynatrace.com/t/dql-table-entity-tags/51423/2 "2025-04-29T15:52:48Z")

</div>

Hi&nbsp;[@AntonPineiro](https://community.dynatrace.com/user/58682)&nbsp;,

“| expand&nbsp; tags” will not help here ? but this will add as rows.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [April 29, 2025, 4:02pm UTC](https://community.dynatrace.com/t/dql-table-entity-tags/51423/3 "2025-04-29T16:02:24Z")

</div>

Hi,

Not because I would like them as columns. It means, from this:

| entity.name | id | tags |
| --- | --- | --- |
| x1 | id1 | field1:value, field2:value |
| x2 | id2 | field1:value, field3:value |

To:

| entity.name | id | tags | field1 | field2 | field3 |
| --- | --- | --- | --- | --- | --- |
| x1 | id1 | field1:value, field2:value | value | value | null |
| x2 | id2 | field1:value, field3:value | value | null | value |

Best regards

---

<div class="post-metadata">

**Author:** ![Akhil-Jayendran](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/akhil-jayendran/32/153_2.png) [@Akhil-Jayendran](https://community.dynatrace.com/u/Akhil-Jayendran)\
**Post date:** [April 29, 2025, 5:57pm UTC](https://community.dynatrace.com/t/dql-table-entity-tags/51423/4 "2025-04-29T17:57:01Z")

</div>

Hi&nbsp;[@AntonPineiro](https://community.dynatrace.com/user/58682)

May be you can try something like this ?

```markup
data record(entity.name = "x1", id = "id1", tags = array("field1:A","field2:C")),
     record(entity.name = "x2", id = "id2", tags = array("field1:B","field3:D"))
| expand tags
| parse tags, "ld:key ':' ld:tag_value"
| fieldsAdd key,tag_value
| summarize { Key_value=collectArray(array(toString(key),tag_value)) }, by: {entity.name}
| fieldsAdd Key_value=toString(Key_value)
| parse Key_value, "'[' KVP{ '[' DQS:key ', ' DQS:value ']' ', '?}:key ']'"
| fieldsFlatten key

```

you will get a result like this, but not sure this will help you

 ![Screenshot 2025-04-29 at 12.54.36 PM.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/4/04b2bc2b8262050de30ef0ca89b7d5b9359cdcea.png)

Regards,

Akhil Jayendran

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [April 30, 2025, 9:20am UTC](https://community.dynatrace.com/t/dql-table-entity-tags/51423/5 "2025-04-30T09:20:57Z")

</div>

Hi,

This is a super awesome answer!!&nbsp;:money\_mouth\_face:🤑

Thank you so much!

Best regards
