# Rename result of a DQL

**URL:** <https://community.dynatrace.com/t/rename-result-of-a-dql/51193>\
**Category:** DQL\
**Tags:** dql\
**Created:** [April 11, 2025, 2:38pm UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193 "2025-04-11T14:38:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Etienne1](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Etienne1](https://community.dynatrace.com/u/Etienne1)\
**Post date:** [April 11, 2025, 2:38pm UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/1 "2025-04-11T14:38:25Z")

</div>

Hello,

Is it possible to rename the result of a DQL query?

 ![Etienne1_0-1744382168671.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/92f1e9ad650791acbce06b99513c9a6dfe7ebff9.png)

I would like to display SQL instead of ‘SP00’ for example

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [April 11, 2025, 3:05pm UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/2 "2025-04-11T15:05:15Z")

</div>

Hello&nbsp;[@Etienne1](https://community.dynatrace.com/user/79556)

How is going? I can help you with that 🙂

You can simply add this code snippet to yours:

```markup
| fieldsAdd Name = replaceString(entityName(dt.entity.host), "SP00", "SQL")
| fields arrayLast(availability), Name

```

and should work as you want.

---

<div class="post-metadata">

**Author:** ![Etienne1](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Etienne1](https://community.dynatrace.com/u/Etienne1)\
**Post date:** [April 14, 2025, 8:20am UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/3 "2025-04-14T08:20:51Z")

</div>

Hello,

Thank you for your help.

After having tried a number of methods I can’t manage to ensure that there is a single column with the name of all the renamed servers and not lots of different columns.

Example of a column I would like to have :

```auto
Host

App
SQL
Web
edit

```

 ![Etienne1_0-1744618376939.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/b/0b385811cd1c1857a9bffdd61fadddc966c62f32.png)

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [April 14, 2025, 9:31am UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/4 "2025-04-14T09:31:15Z")

</div>

Hello,&nbsp;[@Etienne1](https://community.dynatrace.com/user/79556)&nbsp;!

Yeah, make sense, the **fieldsadd** &nbsp;creates a new Field (Column), so putting all in the same&nbsp; **Field** name as “Host”, must work. But I’m not sure what you want, could you share your full example (Change the data of course), and your purpose with this query.

Best regards,

Maximiliano Lopes

---

<div class="post-metadata">

**Author:** ![Etienne1](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Etienne1](https://community.dynatrace.com/u/Etienne1)\
**Post date:** [April 14, 2025, 9:38am UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/5 "2025-04-14T09:38:18Z")

</div>

Hello,

Even when I use the Fields function and not FieldsAdd, it still creates other columns

 ![Etienne1_1-1744623576776.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/9/99b1b07587772c3121de2512df2c1bb9f1d7a0c1.png)

---

<div class="post-metadata">

**Author:** ![Etienne1](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Etienne1](https://community.dynatrace.com/u/Etienne1)\
**Post date:** [April 28, 2025, 7:17am UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/6 "2025-04-28T07:17:39Z")

</div>

Hello,

I managed to rename my servers by parsing the tags,&nbsp;if that helps anyone

 ![Etienne1_2-1745824589930.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/9/799f1c5dcdbda83ed5f9f7799e15957d3fde2d04.png)

here is the result

 ![Etienne1_1-1745824371159.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/83cc2e79ccbfcca882400c7bee3fa015df5df98d.png)

---

<div class="post-metadata">

**Author:** ![susmita\_k](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@susmita\_k](https://community.dynatrace.com/u/susmita_k)\
**Post date:** [August 14, 2025, 6:07pm UTC](https://community.dynatrace.com/t/rename-result-of-a-dql/51193/7 "2025-08-14T18:07:33Z")

</div>

Is there a way to rename a field dynamically ? I am creating a comparison dashboard, and need to show the column like column\_prod, column\_cap. But the environment is a variable and chosen by user. I am not able to rename the column using a variable. Any help is really appreciated.
