<?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 avec condition in Francophones</title>
    <link>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414983#M16922</link>
    <description>&lt;P&gt;Briinou,&lt;/P&gt;
&lt;P&gt;Pour avoir un résultat propre, et si le fait d'avoir une seule table te convient&amp;nbsp; il faut simplement supprimer la table B ( "drop table TabB;" à la fin du script)&lt;/P&gt;
&lt;P&gt;Si par contre tu souhaites conserver 2 tables différentes ce script devrait t'aider :&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_VALEUR&lt;BR /&gt;1, 01/01/2023&lt;BR /&gt;2, 12/02/2023&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TabB :&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_DEB_VALEUR, DT_FIN_VALEUR, VALEUR&lt;BR /&gt;1, 01/01/2019, 31/01/2022, '01/01/19 &amp;gt; 31/01/22'&lt;BR /&gt;1, 01/01/2023, 03/01/2023, '01/01/23 &amp;gt; 03/01/23'&lt;BR /&gt;1, 04/01/2023, 24/06/2023, '01/01/23 &amp;gt; 03/01/23'&lt;BR /&gt;2, 01/02/2020, 31/03/2023, '01/02/20 &amp;gt; 31/03/23'&lt;BR /&gt;2, 01/04/2023, 31/12/2024, '01/04/23 &amp;gt; 31/12/24'&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;TabC:&lt;BR /&gt;IntervalMatch(DT_VALEUR, ID)&lt;BR /&gt;LOAD DT_DEB_VALEUR&lt;BR /&gt;, DT_FIN_VALEUR&lt;BR /&gt;, ID&lt;BR /&gt;Resident TabB;&lt;BR /&gt;&lt;BR /&gt;drop Table TabB;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cdlt,&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 16:23:26 GMT</pubDate>
    <dc:creator>Dref278</dc:creator>
    <dc:date>2024-02-05T16:23:26Z</dc:date>
    <item>
      <title>Left join avec condition</title>
      <link>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414884#M16919</link>
      <description>&lt;P&gt;Bonjour à tous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;j'ai une problématique je n'arrive pas à résoudre :&lt;/P&gt;
&lt;P&gt;- J'ai une table A qui contient les champs suivants ID | DT_VALEUR :&lt;/P&gt;
&lt;P&gt;TabA :&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_VALEUR&lt;BR /&gt;1, 01/01/2023&lt;BR /&gt;2, 12/02/2023&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Une table B qui contient les champs suivants ID | DT_DEB_VALEUR | DT_FIN_VALEUR&lt;/P&gt;
&lt;P&gt;TabB :&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_DEB_VALEUR, DT_FIN_VALEUR&lt;BR /&gt;1, 01/01/2019, 31/01/2022&lt;BR /&gt;1, 01/01/2023, 03/01/2023&lt;BR /&gt;1, 04/01/2023, 24/06/2023&lt;BR /&gt;2, 01/02/2020, 31/03/2023&lt;BR /&gt;2, 01/04/2023, 31/12/2024&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Je souhaiterai créer une 3ème table (TabC par exemple) afin de conserver les éléments de TabA + ne ramener que les lignes de TabB lorsque la DT_VALEUR de TabA est comprise entre les valeurs DT_DEB_VALEUR et DT_FIN_VALEUR de la table B.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TabC :&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD *&lt;BR /&gt;Resident TabA ;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LEFT JOIN&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD *&lt;BR /&gt;Resident TabB&lt;BR /&gt;where DT_VALEUR &amp;lt;= DT_DEB_VALEUR&lt;BR /&gt;and DT_VALEUR &amp;gt;= DT_FIN_VALEUR ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sauf que cela me génère une erreur en me disant que le champ "DT_VALEUR" est introuvable (ce qui est effectivement logique puis qu'il n'existe pas dans TabB).&lt;/P&gt;
&lt;P&gt;Merci par avance pour votre aide&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414884#M16919</guid>
      <dc:creator>Briinou</dc:creator>
      <dc:date>2024-02-05T13:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Left join avec condition</title>
      <link>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414893#M16920</link>
      <description>&lt;P&gt;Bonjour Briinou,&lt;/P&gt;
&lt;P&gt;La solution passe par l'utilisation de la fonction IntervalMatch(), dont la syntaxe n'est pas des plus simple.&lt;/P&gt;
&lt;P&gt;Je t'invite à regarder cet exemple de mise&amp;nbsp; en oeuvre :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=oxQgqXT63gU" target="_blank"&gt;https://www.youtube.com/watch?v=oxQgqXT63gU&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cdlt&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414893#M16920</guid>
      <dc:creator>Dref278</dc:creator>
      <dc:date>2024-02-05T13:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Left join avec condition</title>
      <link>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414955#M16921</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Effectivement, l'utilisation de IntervalMatch n'est pas très intuitive, mais la solution fonctionne et est très efficace sur le nombre de lignes que je traite !&lt;/P&gt;
&lt;P&gt;Merci beaucoup pour la découverte de la fonction ! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Le script de la solution :&lt;/P&gt;
&lt;P&gt;TabA :&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_VALEUR&lt;BR /&gt;1, 01/01/2023&lt;BR /&gt;2, 12/02/2023&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TabB :&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_DEB_VALEUR, DT_FIN_VALEUR, VALEUR1, VALEUR2&lt;BR /&gt;1, 01/01/2019, 31/01/2022, '01/01/19 &amp;gt; 31/01/22', 'Blabla'&lt;BR /&gt;1, 01/01/2023, 03/01/2023, '01/01/23 &amp;gt; 03/01/23',' Bloblo'&lt;BR /&gt;1, 04/01/2023, 24/06/2023, '01/01/23 &amp;gt; 03/01/23', 'Blublu'&lt;BR /&gt;2, 01/02/2020, 31/03/2023, '01/02/20 &amp;gt; 31/03/23', 'Abracadabra'&lt;BR /&gt;2, 01/04/2023, 31/12/2024, '01/04/23 &amp;gt; 31/12/24', 'Plouf'&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IntervalMatch_TABLE :&lt;BR /&gt;IntervalMatch(DT_VALEUR, ID)&lt;BR /&gt;LOAD DT_DEB_VALEUR, DT_FIN_VALEUR, ID Resident TabB;&lt;BR /&gt;LEFT JOIN LOAD ID, DT_VALEUR Resident TabA;&lt;BR /&gt;LEFT JOIN LOAD ID, DT_DEB_VALEUR, DT_FIN_VALEUR, VALEUR1, VALEUR2 Resident TabB;&lt;/P&gt;
&lt;P&gt;DROP TABLES TabA, TabB;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Merci &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 16:21:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414955#M16921</guid>
      <dc:creator>Briinou</dc:creator>
      <dc:date>2024-02-05T16:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Left join avec condition</title>
      <link>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414983#M16922</link>
      <description>&lt;P&gt;Briinou,&lt;/P&gt;
&lt;P&gt;Pour avoir un résultat propre, et si le fait d'avoir une seule table te convient&amp;nbsp; il faut simplement supprimer la table B ( "drop table TabB;" à la fin du script)&lt;/P&gt;
&lt;P&gt;Si par contre tu souhaites conserver 2 tables différentes ce script devrait t'aider :&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_VALEUR&lt;BR /&gt;1, 01/01/2023&lt;BR /&gt;2, 12/02/2023&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TabB :&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, DT_DEB_VALEUR, DT_FIN_VALEUR, VALEUR&lt;BR /&gt;1, 01/01/2019, 31/01/2022, '01/01/19 &amp;gt; 31/01/22'&lt;BR /&gt;1, 01/01/2023, 03/01/2023, '01/01/23 &amp;gt; 03/01/23'&lt;BR /&gt;1, 04/01/2023, 24/06/2023, '01/01/23 &amp;gt; 03/01/23'&lt;BR /&gt;2, 01/02/2020, 31/03/2023, '01/02/20 &amp;gt; 31/03/23'&lt;BR /&gt;2, 01/04/2023, 31/12/2024, '01/04/23 &amp;gt; 31/12/24'&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;TabC:&lt;BR /&gt;IntervalMatch(DT_VALEUR, ID)&lt;BR /&gt;LOAD DT_DEB_VALEUR&lt;BR /&gt;, DT_FIN_VALEUR&lt;BR /&gt;, ID&lt;BR /&gt;Resident TabB;&lt;BR /&gt;&lt;BR /&gt;drop Table TabB;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cdlt,&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 16:23:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414983#M16922</guid>
      <dc:creator>Dref278</dc:creator>
      <dc:date>2024-02-05T16:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Left join avec condition</title>
      <link>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414986#M16923</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Top ! Je venais de trouver la réponse de mon côté en même temps que ton retour.&lt;BR /&gt;C'est parfait, un grand merci &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 16:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Francophones/Left-join-avec-condition/m-p/2414986#M16923</guid>
      <dc:creator>Briinou</dc:creator>
      <dc:date>2024-02-05T16:30:37Z</dc:date>
    </item>
  </channel>
</rss>

