<?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: Merging/Combining multiple tables with programmatic field rename in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111651#M90809</link>
    <description>&lt;P&gt;Far more simple and saving a lot of efforts would be to avoid the qualifying at the beginning.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 06:39:06 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-08-31T06:39:06Z</dc:date>
    <item>
      <title>Merging/Combining multiple tables with programmatic field rename</title>
      <link>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111484#M90794</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have 3 tables of data, all of which have identical fields apart from a prefix which is specific to each source table. I'd like to merge the content of these 3 tables without having to list out all the fields using aliases if possible. Source data looks like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AAA.FieldName1&lt;BR /&gt;AAA.FieldName2&lt;BR /&gt;AAA.FieldName3...&lt;/P&gt;
&lt;P&gt;BBB.FieldName1&lt;BR /&gt;BBB.FieldName2&lt;BR /&gt;BBB.FieldName3...&lt;/P&gt;
&lt;P&gt;CCC.FieldName1&lt;BR /&gt;CCC.FieldName2&lt;BR /&gt;CCC.FieldName3..&lt;/P&gt;
&lt;P&gt;Is it possible to merge the fields inside a for loop using rename and resident load or something so that I end up with the following...&lt;BR /&gt;&lt;BR /&gt;TEST.FieldName1&amp;nbsp; &amp;nbsp; &amp;nbsp;(Has the merged values from&amp;nbsp;AAA.FieldName1, BBB.FieldName1,&amp;nbsp;CCC.FieldName1)&lt;BR /&gt;TEST.FieldName2&amp;nbsp; &amp;nbsp; &amp;nbsp;(Has the merged values from&amp;nbsp;AAA.FieldName2, BBB.FieldName2,&amp;nbsp;CCC.FieldName2)&lt;BR /&gt;TEST.FieldName3&amp;nbsp; &amp;nbsp; &amp;nbsp;(Has the merged values from&amp;nbsp;AAA.FieldName3, BBB.FieldName3,&amp;nbsp;CCC.FieldName3) and so on...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 15:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111484#M90794</guid>
      <dc:creator>jay_pee</dc:creator>
      <dc:date>2023-08-30T15:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/Combining multiple tables with programmatic field rename</title>
      <link>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111492#M90795</link>
      <description>&lt;P&gt;Hi Jay,&lt;/P&gt;
&lt;P&gt;So, I'd say - yes, it's possible, but it's not too simple... The RENAME FIELDS command wouldn't allow merging several fields into one by renaming.&lt;/P&gt;
&lt;P&gt;So, the only viable way is to load (or reload) the source data and rename each field using the AS keyword.&lt;/P&gt;
&lt;P&gt;Now, you can write a loop over the existing fields in each table, and generate the renaming code programmatically. For that, you will need to use the Table functions that allow you to operate with field names in a table that was already loaded into Qlik:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/TableFunctions/table-functions.htm" target="_blank"&gt;https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/TableFunctions/table-functions.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So, the logic of this loop would be this - for each existing field, add another line with the renaming logic into a variable. At the end, perform a RESIDENT load with the generated variable in a&amp;nbsp;$-sign expansion.&lt;/P&gt;
&lt;P&gt;I'm teaching somewhat similar techniques in &lt;A href="https://amzn.to/45yyxdU" target="_blank" rel="noopener"&gt;my book&lt;/A&gt;, you may want to check it out.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 15:22:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111492#M90795</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-08-30T15:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/Combining multiple tables with programmatic field rename</title>
      <link>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111651#M90809</link>
      <description>&lt;P&gt;Far more simple and saving a lot of efforts would be to avoid the qualifying at the beginning.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 06:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Merging-Combining-multiple-tables-with-programmatic-field-rename/m-p/2111651#M90809</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-31T06:39:06Z</dc:date>
    </item>
  </channel>
</rss>

