<?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 Partial rename using field name map in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958728#M946826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been searching the community, but can't seem to find a mapping related post that covers exactly this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load a QVD and do a partial rename on all the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields are names like this FIELDNAME_Current.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to rename them all to FIELDNAME_Prior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to use a For loop for this, and it only works when loading the fields from an Excel file.&amp;nbsp; It doesn't seem to work when loading from a QVD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Dec 2015 19:28:48 GMT</pubDate>
    <dc:creator>gshockxcc</dc:creator>
    <dc:date>2015-12-19T19:28:48Z</dc:date>
    <item>
      <title>Partial rename using field name map</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958728#M946826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been searching the community, but can't seem to find a mapping related post that covers exactly this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load a QVD and do a partial rename on all the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields are names like this FIELDNAME_Current.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to rename them all to FIELDNAME_Prior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to use a For loop for this, and it only works when loading the fields from an Excel file.&amp;nbsp; It doesn't seem to work when loading from a QVD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Dec 2015 19:28:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958728#M946826</guid>
      <dc:creator>gshockxcc</dc:creator>
      <dc:date>2015-12-19T19:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Partial rename using field name map</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958729#M946827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kristan,&lt;/P&gt;&lt;P&gt;Have a look at this script.&lt;/P&gt;&lt;P&gt;After you've loaded from your qvd(s) this script will look for field names ending in '_Current' when it does find one it adds a rowto a mapping table that's used on the final line of the script. I've tested this on a qvd with 25 fields all named ..._Current and all are named ..._Prior in the resulting resident table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 0 to NoOfTables() - 1&lt;/P&gt;&lt;P&gt;TRACE&amp;nbsp; Looking at table : $(vTableName);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vTableName = TableName($(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; for k = 1 to NoOfFields('$(vTableName)')&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vFieldName = FieldName($(k),'$(vTableName)');&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Right('$(vFieldName)',8) = '_Current' then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vNewFieldName =&amp;nbsp; Left('$(vFieldName)',len('$(vFieldName)')-8) &amp;amp; '_Prior';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FieldNameMap:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mapping&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; '$(vFieldName)' as FromFieldName,&lt;/P&gt;&lt;P&gt;&amp;nbsp; '$(vNewFieldName)' as ToFieldName&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if;&lt;/P&gt;&lt;P&gt;&amp;nbsp; NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME Fields using FieldNameMap;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Dec 2015 20:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958729#M946827</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2015-12-19T20:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Partial rename using field name map</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958730#M946828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for your quick response, and for the help.&amp;nbsp; Regards, - Kristan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 12:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-rename-using-field-name-map/m-p/958730#M946828</guid>
      <dc:creator>gshockxcc</dc:creator>
      <dc:date>2015-12-21T12:13:53Z</dc:date>
    </item>
  </channel>
</rss>

