<?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 Using Left Join in one to many relation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231210#M24062</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two files A and B that has a "one to many relation" and I'm using a left join.&lt;/P&gt;&lt;P&gt;I've got duplicate rows since B can contain several records for each A. B can also miss corresponding records for some A records thats why I want to do a Left join.&lt;/P&gt;&lt;P&gt;How should I write in the script to only join with the first record in B if there are more than one?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Code example today:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Transactions&lt;/P&gt;&lt;P&gt;LOAD InvoiceType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status as InvoiceStatus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Network as InvoiceNetwork,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransportCompany as InvoiceCompany,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransportFacility as InvoiceFacility,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerCompany as InvoiceCustomerCompany,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerFacility as InvoiceCustomerFacility,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerAlias as InvoiceCustomerAlias,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LONumber as InvoiceOrderNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderType as InvoiceOrderType;&lt;/P&gt;&lt;P&gt; SQL SELECT * FROM "MyL_PROD_220".OTSDATA.InvoiceTransaction where Network='NET1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Comments&lt;/P&gt;&lt;P&gt; Left Join&lt;/P&gt;&lt;P&gt; LOAD&amp;nbsp; StringKey1 as InvoiceOrderNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CommentString as InvoiceComment;&lt;/P&gt;&lt;P&gt; SQL SELECT * FROM "MyL_PROD_220".OTSDATA.Comment ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2017 18:58:19 GMT</pubDate>
    <dc:creator>magnusrydberg</dc:creator>
    <dc:date>2017-02-07T18:58:19Z</dc:date>
    <item>
      <title>Using Left Join in one to many relation</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231210#M24062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two files A and B that has a "one to many relation" and I'm using a left join.&lt;/P&gt;&lt;P&gt;I've got duplicate rows since B can contain several records for each A. B can also miss corresponding records for some A records thats why I want to do a Left join.&lt;/P&gt;&lt;P&gt;How should I write in the script to only join with the first record in B if there are more than one?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Code example today:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Transactions&lt;/P&gt;&lt;P&gt;LOAD InvoiceType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status as InvoiceStatus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Network as InvoiceNetwork,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransportCompany as InvoiceCompany,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransportFacility as InvoiceFacility,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerCompany as InvoiceCustomerCompany,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerFacility as InvoiceCustomerFacility,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerAlias as InvoiceCustomerAlias,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LONumber as InvoiceOrderNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderType as InvoiceOrderType;&lt;/P&gt;&lt;P&gt; SQL SELECT * FROM "MyL_PROD_220".OTSDATA.InvoiceTransaction where Network='NET1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Comments&lt;/P&gt;&lt;P&gt; Left Join&lt;/P&gt;&lt;P&gt; LOAD&amp;nbsp; StringKey1 as InvoiceOrderNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CommentString as InvoiceComment;&lt;/P&gt;&lt;P&gt; SQL SELECT * FROM "MyL_PROD_220".OTSDATA.Comment ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 18:58:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231210#M24062</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2017-02-07T18:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using Left Join in one to many relation</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231211#M24063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a MAPPING table and ApplyMap() function instead.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2756"&gt;Don't join - use Applymap instead&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your mapping table shows multiple key -&amp;nbsp; value pairs (&lt;EM&gt;[edit: with the same key!]&lt;/EM&gt; like in your case), only the first pair will be considered by design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: something along these lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAP:&lt;/P&gt;&lt;P&gt;MAPPING&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&amp;nbsp; StringKey1 as InvoiceOrderNumber,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CommentString as InvoiceComment;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT * FROM "MyL_PROD_220".OTSDATA.Comment ;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Code example today:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Transactions&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD InvoiceType,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status as InvoiceStatus,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Network as InvoiceNetwork,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransportCompany as InvoiceCompany,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransportFacility as InvoiceFacility,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerCompany as InvoiceCustomerCompany,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerFacility as InvoiceCustomerFacility,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerAlias as InvoiceCustomerAlias,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; ApplyMap('MAP', LONumber, 'no comment found') as InvoiceComment,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LONumber as InvoiceOrderNumber,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderType as InvoiceOrderType;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT * FROM "MyL_PROD_220".OTSDATA.InvoiceTransaction where Network='NET1';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 19:51:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231211#M24063</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-02-07T19:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Left Join in one to many relation</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231212#M24064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Now I see the benefits of using Mapping function instead of Join!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;// Magnus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 08:03:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231212#M24064</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2017-02-08T08:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Left Join in one to many relation</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231213#M24065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your issue is resolved, then please close this thread by flagging correct and / or helpful answers.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 08:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Left-Join-in-one-to-many-relation/m-p/1231213#M24065</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-02-08T08:06:56Z</dc:date>
    </item>
  </channel>
</rss>

