Rename result of a DQL

Hello,

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

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

Hello @Etienne1

How is going? I can help you with that :slightly_smiling_face:

You can simply add this code snippet to yours:

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

and should work as you want.

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 :

Host<br><br>App<br>SQL<br>Web<br>edit

Hello, @Etienne1 !

Yeah, make sense, the fieldsadd creates a new Field (Column), so putting all in the same 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

Hello,

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

Hello,

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

here is the result

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.