<?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 TABLE JOIN in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241152#M91598</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;Your table ITEMMASTER is loaded using several steps, in the first one you have 4 fields, and you add 5 more fields during the other select statements. So the table ITEMMASTER contains 9 fields at the end of the first iteration. When the second one starts you load the 5 first fields in a table ITEMMASTER, but for QV this table contains 9 fields, so it is a different one, called ITEMMASTER-1, where the others fields are added, then you have two tables with different names and same fields, so some synthetic keys.&lt;BR /&gt;You have to load your data in a temporary table first, try something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH REGION IN 'Amanzi','Cape Town','Gauteng','Goschem','Group','Industrial','Kwazulu Natal','North West','Tetralon'&lt;BR /&gt;Tmp_ITEMMASTER:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; '$(REGION)' as Company,&lt;BR /&gt; ItemCode,&lt;BR /&gt; ItemName,&lt;BR /&gt; ItmsGrpCod&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITM.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;// OITW //&lt;BR /&gt; Left Join (ITEMMASTER)&lt;BR /&gt;LOAD&lt;BR /&gt; '$(REGION)' as Company,&lt;BR /&gt; ItemCode,&lt;BR /&gt; WhsCode,&lt;BR /&gt; OnHand&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITW.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;ITEMMASTER:&lt;BR /&gt;Load&lt;BR /&gt; Company,&lt;BR /&gt; ItemCode,&lt;BR /&gt; ItemName,&lt;BR /&gt; ItmsGrpCod,&lt;BR /&gt; WhsCode,&lt;BR /&gt; OnHand,&lt;BR /&gt; RowNo() as RowNo&lt;BR /&gt;resident Tmp_ITEMMASTER;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Drop table Tmp_ITEMMASTER;&lt;/P&gt;&lt;P&gt;NEXT REGION&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I just have added rowno field to avoid a concatenation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2011 09:43:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-08T09:43:38Z</dc:date>
    <item>
      <title>TABLE JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241149#M91595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I am trying to load data from various DB files of which contains the same data structure. In my different DB's I want to join different tables together to get data into one big item master table, instead of sitting with a lot of synthetic keys.&lt;/P&gt;&lt;P&gt;My script at this stage looks like this, it works perfectly for the first region when the 'NEXT REGION' bit is removed. BUT, when it is added, it doesn t join correctly anymore, and also no errors are given. It also creates 4 synthetic keys.&lt;/P&gt;&lt;P&gt;My Code;&lt;/P&gt;&lt;P&gt;// OITM //&lt;BR /&gt;FOR EACH REGION IN 'Amanzi','Cape Town','Gauteng','Goschem','Group','Industrial','Kwazulu Natal','North West','Tetralon'&lt;BR /&gt;ITEMMASTER:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;'$(REGION)' as Company,&lt;BR /&gt;ItemCode,&lt;BR /&gt;ItemName,&lt;BR /&gt;ItmsGrpCod&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITM.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;// OITW //&lt;BR /&gt; Left Join (ITEMMASTER)&lt;BR /&gt;LOAD&lt;BR /&gt;'$(REGION)' as Company,&lt;BR /&gt;ItemCode,&lt;BR /&gt;WhsCode,&lt;BR /&gt;OnHand&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITW.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;// OWHS //&lt;BR /&gt; Left Join (ITEMMASTER)&lt;BR /&gt;LOAD&lt;BR /&gt;'$(REGION)' as Company,&lt;BR /&gt;WhsCode,&lt;BR /&gt;WhsName&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OWHS.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;// OITB //&lt;BR /&gt; Left Join (ITEMMASTER)&lt;BR /&gt;LOAD&lt;BR /&gt;'$(REGION)' as Company,&lt;BR /&gt;ItmsGrpCod,&lt;BR /&gt;ItmsGrpNam&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITB.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;NEXT REGION&lt;/P&gt;&lt;P&gt;Is there any way someone can tell me what I am doing wrong to get this results correctly?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Wynand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 13:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241149#M91595</guid>
      <dc:creator />
      <dc:date>2011-03-07T13:21:42Z</dc:date>
    </item>
    <item>
      <title>TABLE JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241150#M91596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wynand,&lt;/P&gt;&lt;P&gt;I´m not sure if I am going to reply you correctly, but I thing you must use concatenate statement if you relly want to build a main table. I take for sure you have same values on same fields...&lt;/P&gt;&lt;P&gt;That´s all I can tell you.&lt;/P&gt;&lt;P&gt;I hope it helps you, Fiber9906&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 13:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241150#M91596</guid>
      <dc:creator />
      <dc:date>2011-03-07T13:40:34Z</dc:date>
    </item>
    <item>
      <title>TABLE JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241151#M91597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I've a QVW file that attacks some QVD with this script:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Name of the main table&lt;/EM&gt;":&lt;BR /&gt;LOAD * FROM \\xxxx\1.qvd (qvd);&lt;BR /&gt;Concatenate (&lt;EM&gt;"Name of the main table&lt;/EM&gt;")&lt;BR /&gt;LOAD * FROM \\xxxx\2.qvd (qvd);&lt;BR /&gt;Concatenate (&lt;EM&gt;"Name of the main table&lt;/EM&gt;")&lt;/P&gt;&lt;P&gt;Maybe it will work for you.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 17:42:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241151#M91597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-07T17:42:36Z</dc:date>
    </item>
    <item>
      <title>TABLE JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241152#M91598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;Your table ITEMMASTER is loaded using several steps, in the first one you have 4 fields, and you add 5 more fields during the other select statements. So the table ITEMMASTER contains 9 fields at the end of the first iteration. When the second one starts you load the 5 first fields in a table ITEMMASTER, but for QV this table contains 9 fields, so it is a different one, called ITEMMASTER-1, where the others fields are added, then you have two tables with different names and same fields, so some synthetic keys.&lt;BR /&gt;You have to load your data in a temporary table first, try something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH REGION IN 'Amanzi','Cape Town','Gauteng','Goschem','Group','Industrial','Kwazulu Natal','North West','Tetralon'&lt;BR /&gt;Tmp_ITEMMASTER:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; '$(REGION)' as Company,&lt;BR /&gt; ItemCode,&lt;BR /&gt; ItemName,&lt;BR /&gt; ItmsGrpCod&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITM.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;// OITW //&lt;BR /&gt; Left Join (ITEMMASTER)&lt;BR /&gt;LOAD&lt;BR /&gt; '$(REGION)' as Company,&lt;BR /&gt; ItemCode,&lt;BR /&gt; WhsCode,&lt;BR /&gt; OnHand&lt;BR /&gt;FROM&lt;BR /&gt;[$(vQVDPath)$(REGION)\OITW.QVD]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;ITEMMASTER:&lt;BR /&gt;Load&lt;BR /&gt; Company,&lt;BR /&gt; ItemCode,&lt;BR /&gt; ItemName,&lt;BR /&gt; ItmsGrpCod,&lt;BR /&gt; WhsCode,&lt;BR /&gt; OnHand,&lt;BR /&gt; RowNo() as RowNo&lt;BR /&gt;resident Tmp_ITEMMASTER;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Drop table Tmp_ITEMMASTER;&lt;/P&gt;&lt;P&gt;NEXT REGION&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I just have added rowno field to avoid a concatenation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 09:43:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241152#M91598</guid>
      <dc:creator />
      <dc:date>2011-03-08T09:43:38Z</dc:date>
    </item>
    <item>
      <title>TABLE JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241153#M91599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the reply, your suggestion seems to be working just fine, except that now I am struggeling to get the mapping done to bring in Group Name and Warehouse Name. As soon as I try to do the mapping, it created a new table again with -1.&lt;/P&gt;&lt;P&gt;Problem is that I can not map it afterwards as the warehouse code and names differ for all regions, so it has to be done in step 1 where it is running per region.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Wynand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 08:39:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TABLE-JOIN/m-p/241153#M91599</guid>
      <dc:creator />
      <dc:date>2011-03-10T08:39:31Z</dc:date>
    </item>
  </channel>
</rss>

