<?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: mapping table within loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955926#M947523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks, this isnt working for me either. &lt;/P&gt;&lt;P&gt;here is my new script..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vMap = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each vFile in FileList('*.txt')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vBasename = SubField(vFile, '.', 2); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TMP:&lt;/P&gt;&lt;P&gt;LOAD RecNo() as ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IterNo() as SeqNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(RawData,'@@|@@',IterNo()) as SubRawData&lt;/P&gt;&lt;P&gt;While IterNo()&amp;lt;=SubStringCount(RawData,'@@|@@')+1;&lt;/P&gt;&lt;P&gt;LOAD Mid([@1:n],3,Len([@1:n])-4) as RawData&lt;/P&gt;&lt;P&gt;FROM [$(vFile)]&lt;/P&gt;&lt;P&gt;(fix, utf8);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapFieldNames&lt;STRONG&gt;$(vMap):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;mapping LOAD SeqNo, SubRawData Resident TMP&lt;/P&gt;&lt;P&gt;Where ID=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTemp2:&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeqNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubRawData&lt;/P&gt;&lt;P&gt;Resident TMP&lt;/P&gt;&lt;P&gt;Where ID&amp;gt;1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vBasename):&lt;/P&gt;&lt;P&gt;LOAD Distinct ID&lt;/P&gt;&lt;P&gt;Resident TMP&lt;/P&gt;&lt;P&gt;Where ID&amp;gt;1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table TMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = NoOfTables()-1 to 0 STEP -1&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vTable=TableName($(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF WildMatch('$(vTable)', 'tabTemp2.*') THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT JOIN ($(vBasename)) LOAD * RESIDENT [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME Fields using mapFieldNames&lt;STRONG&gt;$&lt;/STRONG&gt;(&lt;STRONG&gt;vMap);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Field ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store $(vBasename) into $(vBasename).qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table $(vBasename);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vMap = $(vMap) + 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Dec 2015 12:01:27 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2015-12-18T12:01:27Z</dc:date>
    <item>
      <title>mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955922#M947517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have a loop in my script that uses a mapping table. the mapping table is used to rename field names. &lt;/P&gt;&lt;P&gt;If i only run it on one file then the output is as expected, but if it runs over multiple files i am getting field names in QVDs that are from the first file (if that makes sense)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each vFile in FileList('*.txt')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vBasename = SubField(vFile, '.', 2); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TMP:&lt;/P&gt;&lt;P&gt;LOAD RecNo() as ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IterNo() as SeqNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(RawData,'@@|@@',IterNo()) as SubRawData&lt;/P&gt;&lt;P&gt;While IterNo()&amp;lt;=SubStringCount(RawData,'@@|@@')+1;&lt;/P&gt;&lt;P&gt;LOAD Mid([@1:n],3,Len([@1:n])-4) as RawData&lt;/P&gt;&lt;P&gt;FROM [$(vFile)]&lt;/P&gt;&lt;P&gt;(fix, utf8);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;mapFieldNames:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;mapping LOAD SeqNo, SubRawData Resident TMP&lt;/P&gt;&lt;P&gt;Where ID=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTemp2:&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeqNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubRawData&lt;/P&gt;&lt;P&gt;Resident TMP&lt;/P&gt;&lt;P&gt;Where ID&amp;gt;1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vBasename):&lt;/P&gt;&lt;P&gt;LOAD Distinct ID&lt;/P&gt;&lt;P&gt;Resident TMP&lt;/P&gt;&lt;P&gt;Where ID&amp;gt;1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table TMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FOR i = NoOfTables()-1 to 0 STEP -1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vTable=TableName($(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF WildMatch('$(vTable)', 'tabTemp2.*') THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT JOIN ($(vBasename)) LOAD * RESIDENT [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME Fields using mapFieldNames;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Field ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store $(vBasename) into $(vBasename).qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table $(vBasename);&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;does anyone know what i can do to 'clear' the mapping table before processing the next file in the loop?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 10:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955922#M947517</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2015-12-18T10:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955923#M947518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Try this:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #ff0000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #ff0000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;LET vInc = 1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FOR Each vFile in FileList('*.txt')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LET vBasename = SubField(vFile, '.', 2);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;TMP:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD RecNo() as ID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IterNo() as SeqNo,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(RawData,'@@|@@',IterNo()) as SubRawData&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;While IterNo()&amp;lt;=SubStringCount(RawData,'@@|@@')+1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD Mid([@1:n],3,Len([@1:n])-4) as RawData&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM [$(vFile)]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;(fix, utf8);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 10pt; font-style: inherit; font-family: inherit;"&gt;mapFieldNames&lt;SPAN style="color: #ff0000;"&gt;$(vInc)&lt;/SPAN&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Mapping&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD SeqNo, SubRawData Resident TMP&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Where ID=1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;tabTemp2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Generic&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD ID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeqNo,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubRawData&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Resident TMP&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Where ID&amp;gt;1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;$(vBasename):&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD Distinct ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Resident TMP&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Where ID&amp;gt;1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;DROP Table TMP;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 10pt; font-style: inherit; font-family: inherit;"&gt;FOR i = NoOfTables()-1 to 0 STEP -1&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; LET vTable=TableName($(i));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; IF WildMatch('$(vTable)', 'tabTemp2.*') THEN&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; LEFT JOIN ($(vBasename)) LOAD * RESIDENT [$(vTable)];&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; DROP TABLE [$(vTable)];&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; ENDIF&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;NEXT i&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;RENAME Fields using mapFieldNames;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;DROP Field ID;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;STORE $(vBasename) into $(vBasename).qvd(qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;DROP Table $(vBasename);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #ff0000;"&gt;Let vInc = $(vInc) + 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;NEXT&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 11:08:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955923#M947518</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-18T11:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955924#M947519</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;This is one of undocumented because the Mapping table is not dropped until after the script finished then the Mapping table stays same during loop. What you have to do is to make the Mapping table unique for each loop. Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;mapFieldNames$(&lt;STRONG&gt;vFile )&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;mapping LOAD SeqNo, SubRawData Resident TMP&lt;/P&gt;&lt;P&gt;Where ID=1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 11:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955924#M947519</guid>
      <dc:creator>Gabriel</dc:creator>
      <dc:date>2015-12-18T11:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955925#M947521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks, i have tried this but it doesnt work either. that gives a mapping table not found error when i try and rename the fields using it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 11:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955925#M947521</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2015-12-18T11:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955926#M947523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks, this isnt working for me either. &lt;/P&gt;&lt;P&gt;here is my new script..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vMap = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each vFile in FileList('*.txt')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vBasename = SubField(vFile, '.', 2); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TMP:&lt;/P&gt;&lt;P&gt;LOAD RecNo() as ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IterNo() as SeqNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(RawData,'@@|@@',IterNo()) as SubRawData&lt;/P&gt;&lt;P&gt;While IterNo()&amp;lt;=SubStringCount(RawData,'@@|@@')+1;&lt;/P&gt;&lt;P&gt;LOAD Mid([@1:n],3,Len([@1:n])-4) as RawData&lt;/P&gt;&lt;P&gt;FROM [$(vFile)]&lt;/P&gt;&lt;P&gt;(fix, utf8);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapFieldNames&lt;STRONG&gt;$(vMap):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;mapping LOAD SeqNo, SubRawData Resident TMP&lt;/P&gt;&lt;P&gt;Where ID=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTemp2:&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeqNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubRawData&lt;/P&gt;&lt;P&gt;Resident TMP&lt;/P&gt;&lt;P&gt;Where ID&amp;gt;1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vBasename):&lt;/P&gt;&lt;P&gt;LOAD Distinct ID&lt;/P&gt;&lt;P&gt;Resident TMP&lt;/P&gt;&lt;P&gt;Where ID&amp;gt;1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table TMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = NoOfTables()-1 to 0 STEP -1&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vTable=TableName($(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF WildMatch('$(vTable)', 'tabTemp2.*') THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT JOIN ($(vBasename)) LOAD * RESIDENT [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME Fields using mapFieldNames&lt;STRONG&gt;$&lt;/STRONG&gt;(&lt;STRONG&gt;vMap);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Field ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store $(vBasename) into $(vBasename).qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table $(vBasename);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vMap = $(vMap) + 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 12:01:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955926#M947523</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2015-12-18T12:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955927#M947524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you change the ApplyMay to match '&lt;SPAN style="font-size: 10pt;"&gt;mapFieldNames$(&lt;STRONG&gt;vFile )'?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 12:02:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955927#M947524</guid>
      <dc:creator>Gabriel</dc:creator>
      <dc:date>2015-12-18T12:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955928#M947525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can use RENAME using mapping load. You need to use ApplyMap within a load statement to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;RENAME Fields using mapFieldNames&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;$&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; text-decoration: line-through;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; text-decoration: line-through;"&gt;vMap);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This won't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 12:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955928#M947525</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-18T12:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955929#M947526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i am not using an applymap. i am using RENAME Fields using mapFieldNames$(vFile); &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 12:32:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955929#M947526</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2015-12-18T12:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: mapping table within loop</title>
      <link>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955930#M947527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding &lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE tabTemp2;&lt;/SPAN&gt; before your loop restarts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 13:42:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/mapping-table-within-loop/m-p/955930#M947527</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2015-12-18T13:42:03Z</dc:date>
    </item>
  </channel>
</rss>

