<?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: Combining 2 tables : key is either one field either another one in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1847681#M70071</link>
    <description>&lt;P&gt;Hi, this script is close, I don't know why in your table expected D=99999 is assigned to B=126.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;Table1:&lt;BR /&gt;Load * inline&lt;BR /&gt;[&lt;BR /&gt;A,B,C,D&lt;BR /&gt;1, 123, FRA0101, 11111&lt;BR /&gt;2, 124, '-', 22222&lt;BR /&gt;3, 125, FRA0202, 33333&lt;BR /&gt;4, 126, '-', 44444&lt;BR /&gt;5, 127, '-', 55555&lt;BR /&gt;6, 128, FRA0303, 66666&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Table2:&lt;BR /&gt;Load * inline&lt;BR /&gt;[&lt;BR /&gt;E, F, G&lt;BR /&gt;11111, abc, rty&lt;BR /&gt;22222, fgh, jkl&lt;BR /&gt;FRA0202, dfv, ghj&lt;BR /&gt;99999, qde, dio&lt;BR /&gt;55555, qsd, sdf&lt;BR /&gt;FRA0303, dfg, nhy&lt;BR /&gt;66666, gta, tya&lt;BR /&gt;77777, erc, avx&lt;BR /&gt;FRA6666, yxs, pgq&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// Load values joined by C&lt;BR /&gt;CJoinValues:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD B,C as D, C as Key, B as BLoaded Resident Table1;&lt;BR /&gt;Inner Join LOAD E, E as Key, F, G, E as ELoaded Resident Table2;&lt;/P&gt;&lt;P&gt;// Load values joined by D not already joined by C&lt;BR /&gt;DJoinValues:&lt;BR /&gt;LOAD B,D, D as Key, B as BLoaded Resident Table1 Where not exists('BLoaded',B);&lt;BR /&gt;Inner Join LOAD E, E as Key, F, G, E as ELoaded Resident Table2;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;BR /&gt;NoConcatenate LOAD * Resident DJoinValues;&lt;BR /&gt;Concatenate LOAD * Resident CJoinValues;&lt;BR /&gt;Concatenate LOAD E, F, G Resident Table2 Where not Exists('ELoaded', E);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP Tables Table1, Table2, DJoinValues, CJoinValues;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Some letters has changed because the first table has 4 columns&lt;/P&gt;</description>
    <pubDate>Sat, 16 Oct 2021 10:04:47 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2021-10-16T10:04:47Z</dc:date>
    <item>
      <title>Combining 2 tables : key is either one field either another one</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1847249#M70046</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;As an image equals many words I've attached to this thread my current struggle.&lt;/P&gt;&lt;P&gt;I've done a lot of test and "workaround" (which means doing and stacking things I don't master and conclude it doesn't work)&lt;/P&gt;&lt;P&gt;I've tried join, keep, concatenate, 2-steps join (table1.B - table2.D, table1.C - table2.D) but nothing return me the result I want, my lines keep being duplicated.&lt;/P&gt;&lt;P&gt;Could you help me resolve this which would also help me get a better understanding&amp;nbsp; of table combination in Qlik ?&lt;/P&gt;&lt;P&gt;Note :&amp;nbsp;&lt;/P&gt;&lt;P&gt;- I want to keep all the lines from table 1 AND table 2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Boulanger_0-1634283382337.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/64379i184E08AC8EFCC012/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Boulanger_0-1634283382337.png" alt="Boulanger_0-1634283382337.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code for loading these dummy tables if you want! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;Table1:&lt;BR /&gt;Load *&lt;BR /&gt;inline&lt;BR /&gt;[&lt;BR /&gt;A,B,C&lt;BR /&gt;1, 123, FRA0101, 11111&lt;BR /&gt;2, 124, '-', 22222&lt;BR /&gt;3, 125, FRA0202, 33333&lt;BR /&gt;4, 126, '-', 44444&lt;BR /&gt;5, 127, '-', 55555&lt;BR /&gt;6, 128, FRA0303, 66666&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;Table2:&lt;BR /&gt;Load *&lt;BR /&gt;inline&lt;BR /&gt;[&lt;BR /&gt;D, E, F&lt;BR /&gt;11111, abc, rty&lt;BR /&gt;22222, fgh, jkl&lt;BR /&gt;FRA0202, dfv, ghj&lt;BR /&gt;99999, qde, dio&lt;BR /&gt;55555, qsd, sdf&lt;BR /&gt;FRA0303, dfg, nhy&lt;BR /&gt;66666, gta, tya&lt;BR /&gt;77777, erc, avx&lt;BR /&gt;FRA6666, yxs, pgq&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;ResultTableExpected:&lt;BR /&gt;Load *&lt;BR /&gt;inline&lt;BR /&gt;[&lt;BR /&gt;Aa, Dd, Ee, Ff&lt;BR /&gt;123, 11111, abc, rty&lt;BR /&gt;124, 22222, fgh, jkl&lt;BR /&gt;125, FRA0202, dfv, ghj&lt;BR /&gt;126, 99999, qde, dio&lt;BR /&gt;127, 55555, qsd, sdf&lt;BR /&gt;128, FRA0303, dfg, nhy&lt;BR /&gt;'-', 66666, gta, tya&lt;BR /&gt;'-', 77777, erc, avx&lt;BR /&gt;'-', FRA6666, yxs, pgq&lt;BR /&gt;];&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Many thanks to the community, I've learned a lot by reading you ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;LI-PRODUCT title="Qlik Sense Enterprise SaaS" id="qlikSenseEnterpriseSaaS"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1847249#M70046</guid>
      <dc:creator>Boulanger</dc:creator>
      <dc:date>2021-11-30T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 tables : key is either one field either another one</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1847681#M70071</link>
      <description>&lt;P&gt;Hi, this script is close, I don't know why in your table expected D=99999 is assigned to B=126.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;Table1:&lt;BR /&gt;Load * inline&lt;BR /&gt;[&lt;BR /&gt;A,B,C,D&lt;BR /&gt;1, 123, FRA0101, 11111&lt;BR /&gt;2, 124, '-', 22222&lt;BR /&gt;3, 125, FRA0202, 33333&lt;BR /&gt;4, 126, '-', 44444&lt;BR /&gt;5, 127, '-', 55555&lt;BR /&gt;6, 128, FRA0303, 66666&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Table2:&lt;BR /&gt;Load * inline&lt;BR /&gt;[&lt;BR /&gt;E, F, G&lt;BR /&gt;11111, abc, rty&lt;BR /&gt;22222, fgh, jkl&lt;BR /&gt;FRA0202, dfv, ghj&lt;BR /&gt;99999, qde, dio&lt;BR /&gt;55555, qsd, sdf&lt;BR /&gt;FRA0303, dfg, nhy&lt;BR /&gt;66666, gta, tya&lt;BR /&gt;77777, erc, avx&lt;BR /&gt;FRA6666, yxs, pgq&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// Load values joined by C&lt;BR /&gt;CJoinValues:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD B,C as D, C as Key, B as BLoaded Resident Table1;&lt;BR /&gt;Inner Join LOAD E, E as Key, F, G, E as ELoaded Resident Table2;&lt;/P&gt;&lt;P&gt;// Load values joined by D not already joined by C&lt;BR /&gt;DJoinValues:&lt;BR /&gt;LOAD B,D, D as Key, B as BLoaded Resident Table1 Where not exists('BLoaded',B);&lt;BR /&gt;Inner Join LOAD E, E as Key, F, G, E as ELoaded Resident Table2;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;BR /&gt;NoConcatenate LOAD * Resident DJoinValues;&lt;BR /&gt;Concatenate LOAD * Resident CJoinValues;&lt;BR /&gt;Concatenate LOAD E, F, G Resident Table2 Where not Exists('ELoaded', E);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP Tables Table1, Table2, DJoinValues, CJoinValues;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Some letters has changed because the first table has 4 columns&lt;/P&gt;</description>
      <pubDate>Sat, 16 Oct 2021 10:04:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1847681#M70071</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-10-16T10:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 tables : key is either one field either another one</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1851155#M70316</link>
      <description>&lt;P&gt;Hi! Thanks for your reply&lt;/P&gt;
&lt;P&gt;You're right I introduced a mistake in my manual "expected table" ; in this case it wouldn't be matched.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still getting duplicated lines with the approach of mapping two time table 1 and table C : one join *2 columns that are the keys. (resultTable : Table1.B join Table2.D join Table1.C..)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 08:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1851155#M70316</guid>
      <dc:creator>Boulanger</dc:creator>
      <dc:date>2021-10-25T08:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 tables : key is either one field either another one</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1851280#M70323</link>
      <description>&lt;P&gt;Hi, can you post wich values are duplicated? The Exists() clause should prevent duplicated.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-2-tables-key-is-either-one-field-either-another-one/m-p/1851280#M70323</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-10-25T12:06:39Z</dc:date>
    </item>
  </channel>
</rss>

