<?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 Rename fields in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428540#M1163766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is there any more..elegance way to rename field in the script then "as" ? &lt;/P&gt;&lt;P&gt;I load it as a crosstable and have to rename it as shown in pict. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="23667" class="jive-image" alt="load year.JPG" src="/legacyfs/online/23667_load year.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Oct 2012 13:05:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-18T13:05:26Z</dc:date>
    <item>
      <title>Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428540#M1163766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is there any more..elegance way to rename field in the script then "as" ? &lt;/P&gt;&lt;P&gt;I load it as a crosstable and have to rename it as shown in pict. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="23667" class="jive-image" alt="load year.JPG" src="/legacyfs/online/23667_load year.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 13:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428540#M1163766</guid>
      <dc:creator />
      <dc:date>2012-10-18T13:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428541#M1163767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can loop through the fields of a table with this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For f = 1 to NoOfFields('data')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldOld = FieldName($(f),'data');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldNew = Replace('$(vFieldOld)','bef','');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RENAME FIELD $(vFieldOld) to $(vFieldNew);&lt;/P&gt;&lt;P&gt;Next f;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... where data is the name of your table, and 'bef' is the string to be replaced with ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 13:45:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428541#M1163767</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-18T13:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428542#M1163768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can rename fields using a Mapping Load, just search the help file for 'Mapping' for a walk through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably not much quicker or easier in the long run though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;P&gt;Qlikview Design Blog: &lt;A href="http://QVDesign.wordpress.com"&gt;http://QVDesign.wordpress.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;@QlikviewBI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 13:45:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428542#M1163768</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2012-10-18T13:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428543#M1163769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as you say map is not a quiker alternative, but the loop function seems to be. Will try that, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 14:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428543#M1163769</guid>
      <dc:creator />
      <dc:date>2012-10-18T14:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428544#M1163770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possibly the easiest way to create a mapping table if you want to avoid looping is by storing the table to a text file then reading it back in with a transformation step as follows ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Method 2 - via mapping table&lt;/P&gt;&lt;P&gt;data2:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;bef2009, bef2010, bef2011, bef2012, bef2013, bef2014, bef2015&lt;/P&gt;&lt;P&gt;1,1,1,1,1,1,1];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;store data2 into data2.txt (txt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FldMap:&lt;/P&gt;&lt;P&gt;MAPPING LOAD @1 as FldNameOld, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(@1,'bef','') as FldNameNew&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[data2.txt]&lt;/P&gt;&lt;P&gt;(txt, utf8, no labels, delimiter is ',', no quotes, filters(&lt;/P&gt;&lt;P&gt;Rotate(left)&lt;/P&gt;&lt;P&gt;));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME FIELDS USING FldMap;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 14:26:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428544#M1163770</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-18T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428545#M1163771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what if the string is not fix, but variable like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load * Inline [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldID, Field_1, Field_2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 136, contact_CustomerSince_group_Name, member_MemberSince_Group_Name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 137, ABC_AdvertisingCountry, ABC_Advertising_Country&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 138, contact_LastPurchase_group, member_LastPurchase_Group&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 139, contact_Discount_Percent_12mon_group_Discount, member_Markdowns_Percent_12mon_Group_Name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 140, contact_RegistrationChannel, member_RegistrationChannel&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 141, contact_LastStoreName, member_LastStore_Name&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 142, transaction_StoreNumber, transaction_Store_Number&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 143, transaction_StoreSalesChannel, transaction_Store_SalesChannel&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 144, transaction_StoreCountry, transaction_Store_Country&lt;BR /&gt;&lt;BR /&gt;]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field_1 is the field to be replaced and field_2 shall stay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 16:41:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428545#M1163771</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2013-02-25T16:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Rename fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428546#M1163772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used a script like this, but it shows always an error message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR &lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfFields&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FieldMap&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vFieldOld&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FieldName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(i)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'FieldMap');&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vFieldOld)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('$(vFieldOld)',8) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vFieldNew&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('$(vFieldOld)','contact', 'member'); &lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;else&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vFieldNew&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('$(vFieldOld)', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;mid&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vFieldOld)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;,13),'member');&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;endif&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;RENAME&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Field&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vFieldOld)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vFieldNew)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;NEXT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 18:35:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rename-fields-in-script/m-p/428546#M1163772</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2013-02-25T18:35:56Z</dc:date>
    </item>
  </channel>
</rss>

