<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Transposing the service ID with its name using DQL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280093#M2232</link>
    <description>&lt;P&gt;If you're filtering by service to look for the hosts it runs on, similar to&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/52584"&gt;@Akhil-Jayendran&lt;/a&gt;'s solution, you can query the `runs_on` relationship on the service entity.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.service
| filter id == "SERVICE-FFB92DD67873FAC7"
| fieldsAdd runsOn = runs_on[dt.entity.host]
| filter isNotNull(runsOn)
| expand runsOn
| fields serviceName = entity.name, hostName = entityName(runsOn, type:"dt.entity.host")&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TracingMySanity_1-1750785658999.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28661iDF96C97FD7334076/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TracingMySanity_1-1750785658999.png" alt="TracingMySanity_1-1750785658999.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2025 17:22:31 GMT</pubDate>
    <dc:creator>TracingMySanity</dc:creator>
    <dc:date>2025-06-24T17:22:31Z</dc:date>
    <item>
      <title>Transposing the service ID with its name using DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280035#M2230</link>
      <description>&lt;P&gt;I have the following DQL query in my dashboard:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| fields entity.name, runs
| fieldsFlatten runs
| filter in(runs.dt.entity.service, $services)
| fields entity.name, runs.dt.entity.service&lt;/LI-CODE&gt;&lt;P&gt;The $services variable returns a list of service IDs, i.e "SERVICE-C1917273162D91".&lt;/P&gt;&lt;P&gt;I would like the query to return a table of hosts and their corresponding services, using hostnames and service names. Here is an example of what I'm trying to achieve:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;hostname&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;service&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;server-01&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;myservice, anotherservice, yetanotherservice&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;server-02&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;myservice&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;server-03&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;anotherservice, yetanotherotherservice&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the actual result I get is:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;entity.name&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;runs.dt.entity.service&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="57px"&gt;server-01&lt;/TD&gt;&lt;TD width="50%" height="57px"&gt;SERVICE-C912138912D19, SERVICE-C1298314717J89, SERVICE-G821398124921B90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;server-02&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;SERVICE-C1298314717J89&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="30px"&gt;server-03&lt;/TD&gt;&lt;TD width="50%" height="30px"&gt;SERVICE-C1298314717J89, SERVICE-G821398124921B90&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using the "lookup" function, but did not have any luck.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.service
| filter in(id, runs.dt.entity.host)
], lookupField:id, sourceField:runs.dt.entity.host&lt;/LI-CODE&gt;&lt;P&gt;How can I display the&amp;nbsp;&lt;U&gt;name of the service&lt;/U&gt;&amp;nbsp;in this table instead, whilst keeping the relationship between the host and its services?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 09:00:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280035#M2230</guid>
      <dc:creator>walkadda</dc:creator>
      <dc:date>2025-06-24T09:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing the service ID with its name using DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280089#M2231</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/92472"&gt;@walkadda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try this probably this will work ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| fields entity.name, runs
| fieldsFlatten runs
| filter in(runs.dt.entity.service, $SERVICE)
| expand runs.dt.entity.service
| fields entity.name, runs.dt.entity.service
|fieldsAdd service_name = lookup([fetch dt.entity.service],
sourceField:runs.dt.entity.service, lookupField:id)[entity.name]&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-06-24 at 11.43.31 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28659i47CD1D9FCA2D274C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-06-24 at 11.43.31 AM.png" alt="Screenshot 2025-06-24 at 11.43.31 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Br&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 16:45:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280089#M2231</guid>
      <dc:creator>Akhil-Jayendran</dc:creator>
      <dc:date>2025-06-24T16:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing the service ID with its name using DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280093#M2232</link>
      <description>&lt;P&gt;If you're filtering by service to look for the hosts it runs on, similar to&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/52584"&gt;@Akhil-Jayendran&lt;/a&gt;'s solution, you can query the `runs_on` relationship on the service entity.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.service
| filter id == "SERVICE-FFB92DD67873FAC7"
| fieldsAdd runsOn = runs_on[dt.entity.host]
| filter isNotNull(runsOn)
| expand runsOn
| fields serviceName = entity.name, hostName = entityName(runsOn, type:"dt.entity.host")&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TracingMySanity_1-1750785658999.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28661iDF96C97FD7334076/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TracingMySanity_1-1750785658999.png" alt="TracingMySanity_1-1750785658999.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 17:22:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Transposing-the-service-ID-with-its-name-using-DQL/m-p/280093#M2232</guid>
      <dc:creator>TracingMySanity</dc:creator>
      <dc:date>2025-06-24T17:22:31Z</dc:date>
    </item>
  </channel>
</rss>

