<?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: Joining two tables in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Joining-two-tables/m-p/223823#M258</link>
    <description>&lt;P&gt;The issue is coming from different data types: the source field "affected_entity_ids" is an array, while the lookup field "id" is a string. The quickest fix here would be to use "expand" to break down the array, e.g:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events, from:now()-24h, to:now()
| filter event.kind == "DAVIS_PROBLEM"
| fields event.start, event.end, display_id, event.category, event.name, affected_entity_ids, root_cause_entity_id, event.status, resolved_problem_duration
| expand affected_entity_ids
| lookup [fetch dt.entity.service], sourceField:affected_entity_ids, lookupField: id&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 25 Sep 2023 20:01:30 GMT</pubDate>
    <dc:creator>Tiit_Hallas</dc:creator>
    <dc:date>2023-09-25T20:01:30Z</dc:date>
    <item>
      <title>Joining two tables</title>
      <link>https://community.dynatrace.com/t5/DQL/Joining-two-tables/m-p/223822#M257</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to join two tables.&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;dt.entity.service&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;"Davis problem events"&lt;/U&gt;.&lt;SPAN&gt;&amp;nbsp;I believe the syntax is correct, and I am not seeing any errors. However, the following DQL shows that there are no matching services. Which sounds incorrect. Am I missing something?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;fetch events, from:now()-24h, to:now()
| filter event.kind == "DAVIS_PROBLEM"
| fields event.start, event.end, display_id, event.category, event.name, affected_entity_ids, root_cause_entity_id, event.status, resolved_problem_duration
| sort event.start desc
| lookup [fetch dt.entity.service],sourceField:affected_entity_ids,lookupField:id
| summarize count=count(), by:{lookup.entity.name}&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="samgarkali_0-1695670515342.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/14279i72983B510DC85857/image-size/medium?v=v2&amp;amp;px=400" role="button" title="samgarkali_0-1695670515342.png" alt="samgarkali_0-1695670515342.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 19:36:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Joining-two-tables/m-p/223822#M257</guid>
      <dc:creator>samgar-kali</dc:creator>
      <dc:date>2023-09-25T19:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Joining two tables</title>
      <link>https://community.dynatrace.com/t5/DQL/Joining-two-tables/m-p/223823#M258</link>
      <description>&lt;P&gt;The issue is coming from different data types: the source field "affected_entity_ids" is an array, while the lookup field "id" is a string. The quickest fix here would be to use "expand" to break down the array, e.g:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events, from:now()-24h, to:now()
| filter event.kind == "DAVIS_PROBLEM"
| fields event.start, event.end, display_id, event.category, event.name, affected_entity_ids, root_cause_entity_id, event.status, resolved_problem_duration
| expand affected_entity_ids
| lookup [fetch dt.entity.service], sourceField:affected_entity_ids, lookupField: id&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Sep 2023 20:01:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Joining-two-tables/m-p/223823#M258</guid>
      <dc:creator>Tiit_Hallas</dc:creator>
      <dc:date>2023-09-25T20:01:30Z</dc:date>
    </item>
  </channel>
</rss>

