<?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: Concatenate Tables with different columns in one New Table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834162#M68870</link>
    <description>&lt;P&gt;Fantastic workaround, thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 07:11:42 GMT</pubDate>
    <dc:creator>QFanatic</dc:creator>
    <dc:date>2021-09-07T07:11:42Z</dc:date>
    <item>
      <title>Concatenate Tables with different columns in one New Table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834054#M68860</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I am reading a lot of &lt;STRONG&gt;disparate&lt;/STRONG&gt; qvd's from a drive (they do have a few key fields in common) and I'd like to concatenate whatever their content, into &lt;STRONG&gt;1&lt;/STRONG&gt; &lt;STRONG&gt;new Table.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how to do this, since the layout of the qvd's are different..an auto concatenate wont take place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run my code as it currently stands, I get 1 MyTable, a MyTable-1 and a Syn table - which is no surprise.&lt;/P&gt;&lt;P&gt;Please may you assist?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for each vX in $(vTables)&lt;BR /&gt;&lt;STRONG&gt;MyTable2:&lt;/STRONG&gt;&lt;BR /&gt;let Path_All = '$(vX)' &amp;amp; '.qvd';&lt;/P&gt;&lt;P&gt;For Each File in filelist(Path_All)&lt;BR /&gt;&lt;STRONG&gt;MyTable:&lt;/STRONG&gt;&lt;BR /&gt;load&lt;BR /&gt;*,&lt;BR /&gt;'$(File)' as Filename,&lt;BR /&gt;left(subfield('$(File)','_',-1) ,6) as Testfield,&lt;BR /&gt;&lt;BR /&gt;'$(vX)' as Main_Table,&lt;BR /&gt;'$(Filename)' as Sub_table&lt;BR /&gt;from&lt;BR /&gt;[$(File)] (qvd)&lt;BR /&gt;where&lt;BR /&gt;left(subfield('$(File)','_',-1),6) &amp;gt;= '$(vExtractPeriod)';&lt;BR /&gt;next File;&lt;BR /&gt;next vX;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 15:12:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834054#M68860</guid>
      <dc:creator>QFanatic</dc:creator>
      <dc:date>2021-09-06T15:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate Tables with different columns in one New Table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834107#M68866</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/83915"&gt;@QFanatic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I read a fantastic and easy workaround in the answers to another question just the other day. It uses the concatenate function to force the tables together. The trouble with a loop is that you can't add the function before the table is created so using an empty variable you can set the concatenation after the first table is created allowing you to get around this issue.&lt;/P&gt;&lt;P&gt;//Set an empty variable&lt;BR /&gt;set vConcatenate =;&lt;/P&gt;&lt;P&gt;for each vX in $(vTables)&lt;BR /&gt;MyTable2:&lt;BR /&gt;let Path_All = '$(vX)' &amp;amp; '.qvd';&lt;/P&gt;&lt;P&gt;For Each File in filelist(Path_All)&lt;/P&gt;&lt;P&gt;//This will be null on the first run&lt;BR /&gt;$(vConcatenate)&lt;/P&gt;&lt;P&gt;MyTable:&lt;BR /&gt;load&lt;BR /&gt;*,&lt;BR /&gt;'$(File)' as Filename,&lt;BR /&gt;left(subfield('$(File)','_',-1) ,6) as Testfield,&lt;/P&gt;&lt;P&gt;'$(vX)' as Main_Table,&lt;BR /&gt;'$(Filename)' as Sub_table&lt;BR /&gt;from&lt;BR /&gt;[$(File)] (qvd)&lt;BR /&gt;where&lt;BR /&gt;left(subfield('$(File)','_',-1),6) &amp;gt;= '$(vExtractPeriod)';&lt;/P&gt;&lt;P&gt;//Set the empty variable to "concatenate" now the first table has been created.&lt;BR /&gt;set vConcatenate = concatenate;&lt;/P&gt;&lt;P&gt;next File;&lt;BR /&gt;next vX;&lt;/P&gt;&lt;P&gt;I hope this works for you.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 00:33:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834107#M68866</guid>
      <dc:creator>anthonyj</dc:creator>
      <dc:date>2021-09-07T00:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate Tables with different columns in one New Table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834162#M68870</link>
      <description>&lt;P&gt;Fantastic workaround, thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 07:11:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Tables-with-different-columns-in-one-New-Table/m-p/1834162#M68870</guid>
      <dc:creator>QFanatic</dc:creator>
      <dc:date>2021-09-07T07:11:42Z</dc:date>
    </item>
  </channel>
</rss>

