<?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 Yet another Concatenation &amp; Join problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225098#M77441</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a master products table with (simplifiyng):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GroupCode&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and several products tables coming from different databases (i have a loop in the script), with identical structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Company&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StandardCost&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I would likt to see all this as a single table, like this:&lt;/P&gt;&lt;P&gt;Products:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GroupCode&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Company&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StandardCost&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In other words, I need Description and GroupCode taken from the master database and StandardCost taken from each single company table.&lt;BR /&gt;The problem is that, If I try by concatenating the master with the other tables, I get duplicated rows from each code, one with correct Description and GroupCode, and others from each other table with null values for Description and GroupCode.&lt;BR /&gt;On the other hand, I tried also with a JOIN in each table with the master, but in this case, I get n table labels "Product, Product-1, etc..." and I need to have a single resulting table. By the way, why I get different table labels, if the tables are identical?&lt;/P&gt;&lt;P&gt;I am sure there is a trivial solution I'm missing....&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jul 2010 11:56:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-07-16T11:56:15Z</dc:date>
    <item>
      <title>Yet another Concatenation &amp; Join problem</title>
      <link>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225098#M77441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a master products table with (simplifiyng):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GroupCode&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and several products tables coming from different databases (i have a loop in the script), with identical structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Company&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StandardCost&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I would likt to see all this as a single table, like this:&lt;/P&gt;&lt;P&gt;Products:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GroupCode&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Company&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StandardCost&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In other words, I need Description and GroupCode taken from the master database and StandardCost taken from each single company table.&lt;BR /&gt;The problem is that, If I try by concatenating the master with the other tables, I get duplicated rows from each code, one with correct Description and GroupCode, and others from each other table with null values for Description and GroupCode.&lt;BR /&gt;On the other hand, I tried also with a JOIN in each table with the master, but in this case, I get n table labels "Product, Product-1, etc..." and I need to have a single resulting table. By the way, why I get different table labels, if the tables are identical?&lt;/P&gt;&lt;P&gt;I am sure there is a trivial solution I'm missing....&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 11:56:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225098#M77441</guid>
      <dc:creator />
      <dc:date>2010-07-16T11:56:15Z</dc:date>
    </item>
    <item>
      <title>Yet another Concatenation &amp; Join problem</title>
      <link>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225099#M77442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Paolo.&lt;/P&gt;&lt;P&gt;You should use a JOIN statement, for example:&lt;/P&gt;&lt;P&gt;Products:&lt;/P&gt;&lt;P&gt;LOAD Code,&lt;BR /&gt;Description,&lt;BR /&gt;GroupCode&lt;/P&gt;&lt;P&gt;FROM master products table;&lt;/P&gt;&lt;P&gt;LEFT JOIN (Products)&lt;/P&gt;&lt;P&gt;LOAD Code,&lt;BR /&gt;Company,&lt;BR /&gt;StandardCost&lt;/P&gt;&lt;P&gt;FROM other table;&lt;/P&gt;&lt;P&gt;after this you get table with such structure:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Products:&lt;BR /&gt;Code&lt;BR /&gt;Description&lt;BR /&gt;GroupCode&lt;BR /&gt;Company&lt;BR /&gt;StandardCost&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 12:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225099#M77442</guid>
      <dc:creator>sparur</dc:creator>
      <dc:date>2010-07-16T12:31:57Z</dc:date>
    </item>
    <item>
      <title>Yet another Concatenation &amp; Join problem</title>
      <link>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225100#M77443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Anatoly,&lt;/P&gt;&lt;P&gt;actually, i didn't find the way to do that, because I have one master table, but several company tables, like that:&lt;/P&gt;&lt;P&gt;- MASTER DB CONNECTION&lt;/P&gt;&lt;P&gt;LOAD.... FROM master products;&lt;/P&gt;&lt;P&gt;- COMPANY 1 DB CONNECTION&lt;BR /&gt;.... other stuff&lt;BR /&gt;LOAD .... FROM other table&lt;BR /&gt;.... other stuff&lt;/P&gt;&lt;P&gt;- COMPANY 2 DB CONNECTION&lt;BR /&gt;.... other stuff&lt;BR /&gt;LOAD .... FROM other table&lt;BR /&gt;.... other stuff&lt;/P&gt;&lt;P&gt;...etc...&lt;/P&gt;&lt;P&gt;In this case, the script you are suggesting is working only for the first company table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 13:01:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225100#M77443</guid>
      <dc:creator />
      <dc:date>2010-07-16T13:01:07Z</dc:date>
    </item>
    <item>
      <title>Yet another Concatenation &amp; Join problem</title>
      <link>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225101#M77444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paola,&lt;/P&gt;&lt;P&gt;The trick is to first load the company tables first after each other. If the tables have the same field structure, they are concatenated automatically to 1 table containing the product costs for all companies. Then at the last step, you can do a right join with the table containing the products and the groups.&lt;/P&gt;&lt;P&gt;The code would look like this:&lt;/P&gt;&lt;P&gt;Products:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; Code,&lt;BR /&gt; Company,&lt;BR /&gt; StandardCost&lt;BR /&gt;FROM&lt;BR /&gt;Company1;&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt; Code,&lt;BR /&gt; Company,&lt;BR /&gt; StandardCost&lt;BR /&gt;FROM&lt;BR /&gt;Company2;&lt;BR /&gt;&lt;BR /&gt;RIGHT JOIN&lt;BR /&gt;LOAD&lt;BR /&gt; Code,&lt;BR /&gt; Description,&lt;BR /&gt; GroupCode&lt;BR /&gt;FROM&lt;BR /&gt;Products;&lt;/P&gt;&lt;P&gt;However, you could also consider to keep 2 tables (1 with products and another with the company/price info). I would prefer this myself, as it avoids double product keys in the table. In the frontend, the data would look the same to an end user. I've included a zip file with both examples attached.&lt;/P&gt;&lt;P&gt;I hope this answers your question.&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 16:35:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225101#M77444</guid>
      <dc:creator />
      <dc:date>2010-07-16T16:35:21Z</dc:date>
    </item>
    <item>
      <title>Yet another Concatenation &amp; Join problem</title>
      <link>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225102#M77445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Daniel,&lt;/P&gt;&lt;P&gt;I was triyng also with a pre-joined SQL view across the database to load from. I will check wich is the faster solution...&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 17:24:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Yet-another-Concatenation-Join-problem/m-p/225102#M77445</guid>
      <dc:creator />
      <dc:date>2010-07-16T17:24:03Z</dc:date>
    </item>
  </channel>
</rss>

