<?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 Script Issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156352#M32239</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;&lt;/P&gt;&lt;P&gt;I have a bit of an issue. I am running a QVW on a server that reloads automatically each day. What happens is data gets imported into a directory and is loaded into the QVW and is then archived into a seperate directory (Moved). So what I need to do is set up a script that will load the data only if it is all there. Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Separate excel sheets called Transactions, Clients, Area, and Product for example. If i get data for Transactions,Clients and Product but not Area, I want the script to skip loading the section that reloads the Area Information. It still needs to bring in the rest of the data though. I have tried the following but unfortunately it is not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DailyFileCheck:&lt;/P&gt;&lt;P&gt;LOAD DailyFileName&lt;/P&gt;&lt;P&gt;FROM '...\Dir'&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', no quotes);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vProcessed = Date(Date#(Mid(peek('DailyFileName',0,DailyFileCheck),13,8),'YYYYMMDD'),'DD/MM/YYYY');&lt;/P&gt;&lt;P&gt;LET vToday = Date(Today()-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ErrorMode = 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exit Script when vProcessed &amp;lt;&amp;gt; Today()-1;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;So if anyone has any suggestions or any ideas, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Mar 2011 10:38:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-11T10:38:53Z</dc:date>
    <item>
      <title>Script Issue</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156352#M32239</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;&lt;/P&gt;&lt;P&gt;I have a bit of an issue. I am running a QVW on a server that reloads automatically each day. What happens is data gets imported into a directory and is loaded into the QVW and is then archived into a seperate directory (Moved). So what I need to do is set up a script that will load the data only if it is all there. Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Separate excel sheets called Transactions, Clients, Area, and Product for example. If i get data for Transactions,Clients and Product but not Area, I want the script to skip loading the section that reloads the Area Information. It still needs to bring in the rest of the data though. I have tried the following but unfortunately it is not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DailyFileCheck:&lt;/P&gt;&lt;P&gt;LOAD DailyFileName&lt;/P&gt;&lt;P&gt;FROM '...\Dir'&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', no quotes);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vProcessed = Date(Date#(Mid(peek('DailyFileName',0,DailyFileCheck),13,8),'YYYYMMDD'),'DD/MM/YYYY');&lt;/P&gt;&lt;P&gt;LET vToday = Date(Today()-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ErrorMode = 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exit Script when vProcessed &amp;lt;&amp;gt; Today()-1;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;So if anyone has any suggestions or any ideas, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 10:38:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156352#M32239</guid>
      <dc:creator />
      <dc:date>2011-03-11T10:38:53Z</dc:date>
    </item>
    <item>
      <title>Script Issue</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156353#M32240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 11:33:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156353#M32240</guid>
      <dc:creator />
      <dc:date>2011-03-11T11:33:22Z</dc:date>
    </item>
    <item>
      <title>Script Issue</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156354#M32241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an application with a kind of historic of the data. When it is reloaded, for each file I check if it exists and if it has already been loaded, and then store the result in a qvd. If the file does not exist I just load the date from the qvd that was created during the last refresh.&lt;/P&gt;&lt;P&gt;Maybe a little more complex than your request, but I hope it can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;BR /&gt;set loadHistoryQvdPath='loadHistory.qvd';&lt;BR /&gt;set fileExt='.txt';&lt;BR /&gt;set qvdExt='.qvd';&lt;/P&gt;&lt;P style="font-weight: bold"&gt;let loadDate=now();&lt;/P&gt;&lt;P style="font-weight: bold"&gt;let hasLoadHistoryQvd = isNull(FileTime('$(loadHistoryQvdPath)'));&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;BR /&gt;if $(hasLoadHistoryQvd) = -1 then&lt;BR /&gt; trace Load History Qvd not found;&lt;BR /&gt; loadHistory:&lt;BR /&gt; load * inline [&lt;BR /&gt; fileName, fileDate, loadDate&lt;BR /&gt; ];&lt;BR /&gt;else&lt;BR /&gt; trace Loading History Qvd;&lt;BR /&gt; loadHistory:&lt;BR /&gt; load&lt;BR /&gt; fileName,&lt;BR /&gt; fileDate,&lt;BR /&gt; loadDate&lt;BR /&gt; from&lt;BR /&gt; $(loadHistoryQvdPath)&lt;BR /&gt; (qvd);&lt;BR /&gt;endif&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;BR /&gt;sub loadFile(fileName)&lt;/P&gt;&lt;P style="font-weight: bold"&gt;let hasQvd = isNull(FileTime('$(fileName)$(qvdExt)'));&lt;BR /&gt;&lt;BR /&gt; if $(hasQvd) = -1 then&lt;BR /&gt; trace qvd file $(fileName)$(qvdExt) not found;&lt;BR /&gt; else&lt;BR /&gt; trace qvd file $(fileName)$(qvdExt) ok;&lt;BR /&gt; load *&lt;BR /&gt; from $(fileName)$(qvdExt)&lt;BR /&gt; (qvd);&lt;BR /&gt;&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; let hasFile = isNull(FileTime('$(fileName)$(fileExt)'));&lt;BR /&gt;&lt;BR /&gt; if $(hasFile) = -1 then&lt;BR /&gt; trace file $(fileName)$(fileExt) not found;&lt;BR /&gt; else&lt;BR /&gt; let fileDate = FileTime('$(fileName)$(fileExt)');&lt;BR /&gt; trace file $(fileName)$(fileExt) ok, date : $(fileDate);&lt;BR /&gt;&lt;BR /&gt; tmp:&lt;BR /&gt; load loadDate resident loadHistory where fileName = '$(fileName)' and fileDate = '$(fileDate)';&lt;BR /&gt;&lt;BR /&gt; if NoOfRows('tmp') &amp;gt; 0 then&lt;BR /&gt; trace file has already been loaded;&lt;BR /&gt; else&lt;BR /&gt; trace load file;&lt;BR /&gt;&lt;BR /&gt; $(fileName):&lt;BR /&gt; load&lt;BR /&gt; '$(loadDate)' as $(fileName)Date,&lt;BR /&gt; *&lt;BR /&gt; from $(fileName)$(fileExt)&lt;BR /&gt; (txt, codepage is 1252, embedded labels, delimiter is ';', msq);&lt;BR /&gt;&lt;BR /&gt; load * inline [&lt;BR /&gt; fileName, fileDate, loadDate&lt;BR /&gt; $(fileName), $(fileDate), $(loadDate)&lt;BR /&gt; ];&lt;BR /&gt;&lt;BR /&gt; store $(fileName) into $(fileName)$(qvdExt);&lt;BR /&gt;&lt;BR /&gt; end if&lt;BR /&gt; drop table tmp;&lt;BR /&gt; end if&lt;/P&gt;&lt;P style="font-weight: bold"&gt;end sub;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;call loadFile('file1');&lt;BR /&gt;call loadFile('file2');&lt;BR /&gt;call loadFile('file3');&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;store loadHistory into $(loadHistoryQvdPath);&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;&lt;I&gt;&lt;B&gt;&lt;/B&gt;&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 11:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Issue/m-p/156354#M32241</guid>
      <dc:creator />
      <dc:date>2011-03-11T11:59:29Z</dc:date>
    </item>
  </channel>
</rss>

