<?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 Renaming Columns of a Dynamic Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Renaming-Columns-of-a-Dynamic-Table/m-p/85191#M14013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im looping through a sql connection that dynamically names certain columns of a table with each pass so each time the 4th, 5th and 6th columns have a different name depending on the contents....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can rename, for example, the 4th, 5th, 6th columns of this table dynamically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2018 14:40:37 GMT</pubDate>
    <dc:creator>prees959</dc:creator>
    <dc:date>2018-05-24T14:40:37Z</dc:date>
    <item>
      <title>Renaming Columns of a Dynamic Table</title>
      <link>https://community.qlik.com/t5/QlikView/Renaming-Columns-of-a-Dynamic-Table/m-p/85191#M14013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im looping through a sql connection that dynamically names certain columns of a table with each pass so each time the 4th, 5th and 6th columns have a different name depending on the contents....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can rename, for example, the 4th, 5th, 6th columns of this table dynamically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 14:40:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Renaming-Columns-of-a-Dynamic-Table/m-p/85191#M14013</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2018-05-24T14:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Columns of a Dynamic Table</title>
      <link>https://community.qlik.com/t5/QlikView/Renaming-Columns-of-a-Dynamic-Table/m-p/85192#M14014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within the load itself it's not possible but you could change them afterwards maybe with something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 4 to 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let FieldName = fieldname($(i), tablename(nooftables()));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rename field $(FieldName) to FieldXYZ;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course you need also some logic to define the right name to the right field - and you couldn't change it to an already existing fieldname (if this is needed you need some more logic).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also a reverse approach is possible by creating a load-statement on the fly by loading the first record from the table, looping through all fieldnames and creating with them a load-string including some logic to replace the wrong fieldnames with the right ones - an then applying this load-string to the real load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2018 07:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Renaming-Columns-of-a-Dynamic-Table/m-p/85192#M14014</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-25T07:51:32Z</dc:date>
    </item>
  </channel>
</rss>

