# Rename column name dynamically using variable

**URL:** <https://community.dynatrace.com/t/rename-column-name-dynamically-using-variable/52960>\
**Category:** DQL\
**Tags:** dql, notebooks, dpl\
**Created:** [August 14, 2025, 6:08pm UTC](https://community.dynatrace.com/t/rename-column-name-dynamically-using-variable/52960 "2025-08-14T18:08:17Z")\
**Posts on this page:** 2\
**Page:** 1

<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:08pm UTC](https://community.dynatrace.com/t/rename-column-name-dynamically-using-variable/52960/1 "2025-08-14T18:08:17Z")

</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.

---

<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:** [August 15, 2025, 8:21pm UTC](https://community.dynatrace.com/t/rename-column-name-dynamically-using-variable/52960/2 "2025-08-15T20:21:54Z")

</div>

Hello&nbsp;[@susmita\_k](https://community.dynatrace.com/user/67050)&nbsp;,

I think it is technically possible to use a variable in a dashboard, and this variable can be used to rename the field, something like this.

 ![Screenshot 2025-08-15 at 3.20.30 PM.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/d/9d30aa6eacf85a1f059733ba8e2cfb6a96cb0c08.png)

Used sample dql is

```javascript
data record( a= "test", b= 3),
     record( a= "test1", b= 7),
     record( a= "test", b= 13),
     record( a= "test2", b= 10),
     record( a= "test3", b= 31),
     record( a= "test2", b= 45)
  | filter a==$Variable1
  | summarize `$Variable1`=sum(b)

```

> **[Add a variable to a dashboard](https://docs.dynatrace.com/docs/analyze-explore-automate/dashboards-and-notebooks/dashboards-new/components/dashboard-component-variable)**
>
> Add variables to your Dynatrace dashboards.

I’m not certain about your requirement, but maybe you can think in this direction or provide the exact requirement along with a sample query so we can look into it.
