<?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 Is there a way to use &amp;quot;Rename fields using FieldMap&amp;quot; instead of &amp;quot;load field as fild_alias&amp;quot; to achieve a certain join schema? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Is-there-a-way-to-use-quot-Rename-fields-using-FieldMap-quot/m-p/440481#M164171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The usual way would be LOAD id AS clientID FROM client.qvd ... and LOAD id AS ClaimID, clientID FROM claim.qvd. So table_name.id should become table_nameID and it will be automatically joined to the foreign key. &lt;/P&gt;&lt;P&gt;But I have 200 such tables and would like to do that all in a loop (i.e. not editing the load statements by hand). Below you find an example of such a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;datadictionary: LOAD * Inline [&lt;/P&gt;&lt;P&gt;oldnames, newnames&lt;/P&gt;&lt;P&gt;Client.id,clientID&lt;/P&gt;&lt;P&gt;Claim.id,claimID&lt;/P&gt;&lt;P&gt;Claim.clientID,clientID&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;FieldMap: Mapping load oldnames, newnames Resident datadictionary;&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY clientID;&lt;/P&gt;&lt;P&gt;for each file in filelist('*.qvd')&lt;/P&gt;&lt;P&gt;temp: load FileBasename() as tablename From $(file) (qvd) where RecNo()=1; &lt;/P&gt;&lt;P&gt;let tablename = peek('temp.tablename',0,temp);&lt;/P&gt;&lt;P&gt;'$(tablename)': LOAD * FROM $(file) (qvd);&lt;/P&gt;&lt;P&gt;Rename fields using FieldMap;&lt;/P&gt;&lt;P&gt;DROP table temp;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is "id" from Client table can not be renamed to clientID. I understand this is because it does not happen during the load. &lt;/P&gt;&lt;P&gt;Is there a cure? Can I ask Qlikview to reload that table somehow with the new names?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second complication is that there are other technical columns (like creation_date, row_status, etc.) in each table. They would cause unwanted synth keys. So I need to use Qualify if I do not want to chase them through all tables. Not sure if this all can live in one script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand this is a bit of a complicated set-up but I am happy to clarify. So please do not hesitate to ask for the clarification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2012 16:54:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-09-25T16:54:08Z</dc:date>
    <item>
      <title>Is there a way to use "Rename fields using FieldMap" instead of "load field as fild_alias" to achieve a certain join schema?</title>
      <link>https://community.qlik.com/t5/QlikView/Is-there-a-way-to-use-quot-Rename-fields-using-FieldMap-quot/m-p/440481#M164171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The usual way would be LOAD id AS clientID FROM client.qvd ... and LOAD id AS ClaimID, clientID FROM claim.qvd. So table_name.id should become table_nameID and it will be automatically joined to the foreign key. &lt;/P&gt;&lt;P&gt;But I have 200 such tables and would like to do that all in a loop (i.e. not editing the load statements by hand). Below you find an example of such a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;datadictionary: LOAD * Inline [&lt;/P&gt;&lt;P&gt;oldnames, newnames&lt;/P&gt;&lt;P&gt;Client.id,clientID&lt;/P&gt;&lt;P&gt;Claim.id,claimID&lt;/P&gt;&lt;P&gt;Claim.clientID,clientID&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;FieldMap: Mapping load oldnames, newnames Resident datadictionary;&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY clientID;&lt;/P&gt;&lt;P&gt;for each file in filelist('*.qvd')&lt;/P&gt;&lt;P&gt;temp: load FileBasename() as tablename From $(file) (qvd) where RecNo()=1; &lt;/P&gt;&lt;P&gt;let tablename = peek('temp.tablename',0,temp);&lt;/P&gt;&lt;P&gt;'$(tablename)': LOAD * FROM $(file) (qvd);&lt;/P&gt;&lt;P&gt;Rename fields using FieldMap;&lt;/P&gt;&lt;P&gt;DROP table temp;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is "id" from Client table can not be renamed to clientID. I understand this is because it does not happen during the load. &lt;/P&gt;&lt;P&gt;Is there a cure? Can I ask Qlikview to reload that table somehow with the new names?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second complication is that there are other technical columns (like creation_date, row_status, etc.) in each table. They would cause unwanted synth keys. So I need to use Qualify if I do not want to chase them through all tables. Not sure if this all can live in one script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand this is a bit of a complicated set-up but I am happy to clarify. So please do not hesitate to ask for the clarification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 16:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-there-a-way-to-use-quot-Rename-fields-using-FieldMap-quot/m-p/440481#M164171</guid>
      <dc:creator />
      <dc:date>2012-09-25T16:54:08Z</dc:date>
    </item>
  </channel>
</rss>

