<?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: Left Join Lows in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909783#M74976</link>
    <description>&lt;P&gt;Hi, you should use intervalmatch for this. I'm guessing the dimension "MRN" is a common between both tables, so the script would look like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;ENCOUNTERS:
Load 
PAT_ENC_CSN_ID,
MRN,
Admission_Dttm,
Discharge_Dttm INLINE
[
PAT_ENC_CSN_ID,MRN,Admission_Dttm,Discharge_Dttm
1,A,20.03.2022,23.03.2022
2,B,21.03.2022,22.03.2022
3,C,22.03.2022,25.03.2022
4,C,20.03.2022,21.03.2022
5,B,24.03.2022,25.03.2022
6,A,21.03.2022,25.03.2022
];

ESCALATIONS:
Load
MRN,
Escalation_Dttm INLINE 
[
MRN,Escalation_Dttm
A,21.03.2022
B,24.03.2022
C,22.03.2022
];

INTERVALMATCH(Escalation_Dttm,MRN)
LEFT JOIN (ESCALATIONS)
LOAD DISTINCT
Admission_Dttm,
Discharge_Dttm,
MRN
RESIDENT ENCOUNTERS;

LEFT JOIN (ESCALATIONS)
LOAD DISTINCT
Admission_Dttm,
Discharge_Dttm,
MRN,
PAT_ENC_CSN_ID AS PAT_ENC_CSN_ID_JOINED
RESIDENT ENCOUNTERS;

DROP FIELDS Admission_Dttm,Discharge_Dttm FROM ESCALATIONS;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;If the "MRN" isn't needed for the join, just remove it from intervalmatch and left join.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 10:27:22 GMT</pubDate>
    <dc:creator>RsQK</dc:creator>
    <dc:date>2022-03-25T10:27:22Z</dc:date>
    <item>
      <title>Left Join Lows</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909415#M74962</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This seems like an easy thing to do, but I'm stuck. I want to add a value (PAT_ENC_CSN_ID) found in one table (ENCOUNTERS) to another (ESCALATIONS), using a where clause. (In SQL, I would use a left join, but these tables have different data sources, so that's not feasible.)&lt;/P&gt;
&lt;P&gt;ENCOUNTERS:&lt;/P&gt;
&lt;P&gt;Load PAT_ENC_CSN_ID,&lt;/P&gt;
&lt;P&gt;MRN,&lt;/P&gt;
&lt;P&gt;Admission_Dttm,&lt;/P&gt;
&lt;P&gt;Discharge_Dttm;&lt;/P&gt;
&lt;P&gt;ESCALATIONS:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;MRN,&lt;/P&gt;
&lt;P&gt;Escalation_Dttm;&lt;/P&gt;
&lt;P&gt;Left Join&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;PAT_ENC_CSN_ID&lt;/P&gt;
&lt;P&gt;Resident ENCOUNTERS&lt;/P&gt;
&lt;P&gt;where&amp;nbsp;Escalation_Dttm &amp;gt;= Admission_Dttm&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;Escalation_Dttm &amp;lt;=&amp;nbsp;Discharge_Dttm;&lt;/P&gt;
&lt;P&gt;Naturally, I get an error because ENCOUNTERS doesn't have&amp;nbsp;Escalation_Dttm&amp;nbsp; in it. Any suggestions?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 14:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909415#M74962</guid>
      <dc:creator>cfountain72</dc:creator>
      <dc:date>2022-03-24T14:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join Lows</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909783#M74976</link>
      <description>&lt;P&gt;Hi, you should use intervalmatch for this. I'm guessing the dimension "MRN" is a common between both tables, so the script would look like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;ENCOUNTERS:
Load 
PAT_ENC_CSN_ID,
MRN,
Admission_Dttm,
Discharge_Dttm INLINE
[
PAT_ENC_CSN_ID,MRN,Admission_Dttm,Discharge_Dttm
1,A,20.03.2022,23.03.2022
2,B,21.03.2022,22.03.2022
3,C,22.03.2022,25.03.2022
4,C,20.03.2022,21.03.2022
5,B,24.03.2022,25.03.2022
6,A,21.03.2022,25.03.2022
];

ESCALATIONS:
Load
MRN,
Escalation_Dttm INLINE 
[
MRN,Escalation_Dttm
A,21.03.2022
B,24.03.2022
C,22.03.2022
];

INTERVALMATCH(Escalation_Dttm,MRN)
LEFT JOIN (ESCALATIONS)
LOAD DISTINCT
Admission_Dttm,
Discharge_Dttm,
MRN
RESIDENT ENCOUNTERS;

LEFT JOIN (ESCALATIONS)
LOAD DISTINCT
Admission_Dttm,
Discharge_Dttm,
MRN,
PAT_ENC_CSN_ID AS PAT_ENC_CSN_ID_JOINED
RESIDENT ENCOUNTERS;

DROP FIELDS Admission_Dttm,Discharge_Dttm FROM ESCALATIONS;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;If the "MRN" isn't needed for the join, just remove it from intervalmatch and left join.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 10:27:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909783#M74976</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2022-03-25T10:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join Lows</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909867#M74984</link>
      <description>&lt;P&gt;Thank you so much! This gift of knowledge was extremely useful, and was obviously a little more complicated than I was expecting.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 13:37:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-Lows/m-p/1909867#M74984</guid>
      <dc:creator>cfountain72</dc:creator>
      <dc:date>2022-03-25T13:37:40Z</dc:date>
    </item>
  </channel>
</rss>

