<?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: Replace loop table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265791#M620077</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't think you can use a function directly as the table argument to STORE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest changing the 'LET d =' instead of the STORE:&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: 13.3333px;"&gt;LET d = &lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TableName(i);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;LET t = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;replace(&lt;/SPAN&gt;d&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;,'fact','')&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;STORE '$(t)' INTO '$(vDataStoreDir)'S1-'$(d).qvd';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The latter can perhaps be written as follows for clarity:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;STORE [$(t)] INTO [$(vDataStoreDir)S1-$(d).qvd];&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2017 20:30:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-02-27T20:30:59Z</dc:date>
    <item>
      <title>Replace loop table</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265790#M620076</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;I have the below script which loops through a list of sql tables that I have listed on the I previous sheet script and stores this into a QVD. Some of the table names I want to replace a finding word with an empty text, but I am getting a error when I tried the below amendment, any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Current script&lt;/P&gt;&lt;P&gt;LET vDataStoreDir = '..\02_QVD\';&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;&amp;nbsp; LET d = TableName(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; STORE '$(d)' INTO '$(vDataStoreDir)'S1-'$(d).qvd';&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;LET j = nooftables();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO WHILE j &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET d = TableName(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE '$(d)';&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET j = nooftables();&lt;/P&gt;&lt;P&gt;LOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;//Amended script&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LET vDataStoreDir = '..\02_QVD\';&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FOR i = 0 TO NoOfTables() - 1&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; LET d = TableName(i);&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; STORE replace('$(d)','fact','') INTO '$(vDataStoreDir)'S1-'$(d).qvd';&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;NEXT&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LET j = nooftables();&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;DO WHILE j &amp;gt; 0&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; LET d = TableName(0);&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; DROP TABLE '$(d)';&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; LET j = nooftables();&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOOP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 23:09:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265790#M620076</guid>
      <dc:creator>ivandrago</dc:creator>
      <dc:date>2017-02-24T23:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Replace loop table</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265791#M620077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't think you can use a function directly as the table argument to STORE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest changing the 'LET d =' instead of the STORE:&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: 13.3333px;"&gt;LET d = &lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TableName(i);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;LET t = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;replace(&lt;/SPAN&gt;d&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;,'fact','')&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;STORE '$(t)' INTO '$(vDataStoreDir)'S1-'$(d).qvd';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The latter can perhaps be written as follows for clarity:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;STORE [$(t)] INTO [$(vDataStoreDir)S1-$(d).qvd];&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 20:30:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265791#M620077</guid>
      <dc:creator />
      <dc:date>2017-02-27T20:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Replace loop table</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265792#M620078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Must it not be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;STORE '$(&lt;STRONG&gt;d&lt;/STRONG&gt;)' INTO '$(vDataStoreDir)'S1-'$(&lt;STRONG&gt;t&lt;/STRONG&gt;).qvd';&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach could be the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = 0 TO NoOfTables() - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET source = TableName(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET target = replace(TableName(i),'fact','');&lt;/P&gt;&lt;P&gt;&amp;nbsp; Rename table $(source) to $(target);&lt;/P&gt;&lt;P&gt;&amp;nbsp; STORE '$(target)' INTO '$(vDataStoreDir)'S1-'$(target).qvd';&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 08:41:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-loop-table/m-p/1265792#M620078</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-02-28T08:41:48Z</dc:date>
    </item>
  </channel>
</rss>

