cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename result of a DQL

Etienne1
Helper

Hello,

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

Etienne1_0-1744382168671.png

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

4 REPLIES 4

MaximilianoML
Helper

Hello @Etienne1 

How is going? I can help you with that 🙂

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.

 

Fullstack developer | Tech Lover

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

App
SQL
Web
edit

Etienne1_0-1744618376939.png

 

MaximilianoML
Helper

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

 

Fullstack developer | Tech Lover

Hello,

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

Etienne1_1-1744623576776.png

 

 

Featured Posts