<?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 Concatenate in a loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252334#M95658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a problem creating a single table in a loop.&amp;nbsp; I have the code below that counts the number of files and combines 3 files in a loop.&amp;nbsp; Everything is working correctly except that the loop produces a table for each loop process and creates a synthetic key linking the tables together.&amp;nbsp; I would like them to concatenate together, and am confused why they aren't automatically concatenating as they all have the exact same field names.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set NoOfFiles = 0;&lt;BR /&gt;For each file in filelist ('D:\ar\Production Scripts 11-4-11\Data\MetaData\System*.qvw.Fields.tab');&lt;BR /&gt;Let NoOfFiles = NoOfFiles + 1;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;for I = 1 to $(NoOfFiles)&lt;BR /&gt;load&lt;BR /&gt; FieldName, &lt;BR /&gt; DistinctOnly, &lt;BR /&gt; Cardinal, &lt;BR /&gt; TotalCount, &lt;BR /&gt; PossibleCount, &lt;BR /&gt; HasInfo, &lt;BR /&gt; IsLocked, &lt;BR /&gt; AlwaysOneSelected, &lt;BR /&gt; AndMode&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD FieldName, &lt;BR /&gt; TableName&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD TableName, &lt;BR /&gt; Loose, &lt;BR /&gt; #Records, &lt;BR /&gt; #Fields, &lt;BR /&gt; #Keys&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;BR /&gt;next I;&lt;/D&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Nov 2011 20:20:51 GMT</pubDate>
    <dc:creator>jdf</dc:creator>
    <dc:date>2011-11-23T20:20:51Z</dc:date>
    <item>
      <title>Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252334#M95658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a problem creating a single table in a loop.&amp;nbsp; I have the code below that counts the number of files and combines 3 files in a loop.&amp;nbsp; Everything is working correctly except that the loop produces a table for each loop process and creates a synthetic key linking the tables together.&amp;nbsp; I would like them to concatenate together, and am confused why they aren't automatically concatenating as they all have the exact same field names.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set NoOfFiles = 0;&lt;BR /&gt;For each file in filelist ('D:\ar\Production Scripts 11-4-11\Data\MetaData\System*.qvw.Fields.tab');&lt;BR /&gt;Let NoOfFiles = NoOfFiles + 1;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;for I = 1 to $(NoOfFiles)&lt;BR /&gt;load&lt;BR /&gt; FieldName, &lt;BR /&gt; DistinctOnly, &lt;BR /&gt; Cardinal, &lt;BR /&gt; TotalCount, &lt;BR /&gt; PossibleCount, &lt;BR /&gt; HasInfo, &lt;BR /&gt; IsLocked, &lt;BR /&gt; AlwaysOneSelected, &lt;BR /&gt; AndMode&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD FieldName, &lt;BR /&gt; TableName&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD TableName, &lt;BR /&gt; Loose, &lt;BR /&gt; #Records, &lt;BR /&gt; #Fields, &lt;BR /&gt; #Keys&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;BR /&gt;next I;&lt;/D&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 20:20:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252334#M95658</guid>
      <dc:creator>jdf</dc:creator>
      <dc:date>2011-11-23T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252335#M95659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that the problem is that in the second loop the first load sentence try to concatenate with the table loaded in the first loop, before have been done the LEFT JOINS and in consecuence without the fields added in this JOINS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can do it if you try concatenate the 3 tables that you are making LEFT JOIN in 3 separate tables in the loop and after that make the joins between this 3 concatenated tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 21:32:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252335#M95659</guid>
      <dc:creator />
      <dc:date>2011-11-23T21:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252336#M95660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried setting a label to the table instead leaving that QlikView sets a random name?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;for I = 1 to $(NoOfFiles)&lt;/P&gt;&lt;P&gt;Table: // fixed for all the files&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;FieldName, &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;BI Consultant&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 21:54:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252336#M95660</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-11-23T21:54:53Z</dc:date>
    </item>
    <item>
      <title>Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252337#M95661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Claudio - Thanks for the suggestion but that won't work and the left joins need to be done in step.&amp;nbsp; If I join the tables right away they join on a 1 to many relationship which works nicely.&amp;nbsp; If I concatenate then left join I will be joining many to many which will cause duplicated data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel - Thanks for the suggestion but it didn't work I get the same result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 22:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252337#M95661</guid>
      <dc:creator>jdf</dc:creator>
      <dc:date>2011-11-23T22:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252338#M95662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Force concatenation using the CONCATENATE keyword before the first LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 22:06:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252338#M95662</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-11-23T22:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252339#M95663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if you store in a separate qvd and drop from the memory the table generated in each loop and then make a second loop to load from the qvd the tables again?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 22:16:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252339#M95663</guid>
      <dc:creator />
      <dc:date>2011-11-23T22:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252340#M95664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I have tried that as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 22:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252340#M95664</guid>
      <dc:creator>jdf</dc:creator>
      <dc:date>2011-11-23T22:21:43Z</dc:date>
    </item>
    <item>
      <title>Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252341#M95665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think if you want to join after every load, then you must continue to create three seperate tables and concatenate them together in a final step. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you force CONCATENATE the tables while loading, you'll get the "spoiled table" problem. For example, after the first join, the target table will contain the new field "TableName". When you add rows in the second load, null vallue will be assigned for TableName in those new rows. The next join will match zero rows, as there will be no matches between the null TableName in the target table and the non-null TableName in the source table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 00:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252341#M95665</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-11-24T00:55:27Z</dc:date>
    </item>
    <item>
      <title>Concatenate in a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252342#M95666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for everyone's input I have added a step at the end renaming the fields and then dropping the original table, it works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set NoOfFiles = 0;&lt;BR /&gt;For each file in filelist ('D:\ar\Production Scripts 11-4-11\Data\MetaData\System*.qvw.Fields.tab');&lt;BR /&gt;Let NoOfFiles = NoOfFiles + 1;&lt;/P&gt;&lt;P&gt;next&lt;BR /&gt; for I = 1 to $(NoOfFiles)&lt;BR /&gt;Table:&lt;BR /&gt;load&lt;BR /&gt; FieldName, &lt;BR /&gt; DistinctOnly, &lt;BR /&gt; Cardinal, &lt;BR /&gt; TotalCount, &lt;BR /&gt; PossibleCount, &lt;BR /&gt; HasInfo, &lt;BR /&gt; IsLocked, &lt;BR /&gt; AlwaysOneSelected, &lt;BR /&gt; AndMode&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD &lt;BR /&gt; FieldName,&lt;BR /&gt; TableName&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD &lt;BR /&gt; TableName, &lt;BR /&gt; Loose, &lt;BR /&gt; #Records, &lt;BR /&gt; #Fields, &lt;BR /&gt; #Keys&lt;BR /&gt;FROM &lt;D&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/D&gt;&lt;/P&gt;&lt;P&gt;tmpMetadata:&lt;BR /&gt;Load&amp;nbsp; &lt;BR /&gt; FieldName&amp;nbsp;&amp;nbsp;&amp;nbsp; as [Field Name], &lt;BR /&gt;// DistinctOnly&amp;nbsp; as [Count Distinct], &lt;BR /&gt; Cardinal&amp;nbsp;&amp;nbsp; as [Count Distinct], &lt;BR /&gt; TotalCount&amp;nbsp;&amp;nbsp; as [Count Total], &lt;BR /&gt;// PossibleCount&amp;nbsp; as [Count Possible], &lt;BR /&gt;// HasInfo&amp;nbsp;&amp;nbsp;&amp;nbsp; as [Has Info], &lt;BR /&gt;// IsLocked&amp;nbsp;&amp;nbsp; as [Is Locked], &lt;BR /&gt;// AlwaysOneSelected&amp;nbsp; as [Always One Selected], &lt;BR /&gt;// AndMode&amp;nbsp;&amp;nbsp;&amp;nbsp; as [And Mode],&lt;BR /&gt; TableName&amp;nbsp;&amp;nbsp; as [Table Name],&lt;BR /&gt;// Loose&amp;nbsp;&amp;nbsp;&amp;nbsp; as [Loose], &lt;BR /&gt; #Records&amp;nbsp;&amp;nbsp; as [# of Records], &lt;BR /&gt; #Fields&amp;nbsp;&amp;nbsp;&amp;nbsp; as [# of Fields], &lt;BR /&gt; #Keys&amp;nbsp;&amp;nbsp;&amp;nbsp; as [# of Keys],&lt;BR /&gt; $(I)&amp;nbsp;&amp;nbsp;&amp;nbsp; as [File Num]&lt;BR /&gt;resident Table;&lt;/P&gt;&lt;P&gt;drop Table Table;&lt;BR /&gt;next I;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 00:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-in-a-loop/m-p/252342#M95666</guid>
      <dc:creator>jdf</dc:creator>
      <dc:date>2011-11-28T00:57:16Z</dc:date>
    </item>
  </channel>
</rss>

