<?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 Read internet file with a loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204146#M1209196</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'm a new QV user. Maybe my question is trivial.&lt;/P&gt;&lt;P&gt;I want to read several files on the web with different name but with the same structure (web page)&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;http://www.parisavelo.net/detail-station-11001-b.htm&lt;/P&gt;&lt;P&gt;I know how to read this page.&lt;/P&gt;&lt;P&gt;To help me , I have an excel file with the name of all the files i want to read.&lt;/P&gt;&lt;P&gt;How can i make script to make a loop ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;Jean-Jacques&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Nov 2009 16:02:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-11-11T16:02:53Z</dc:date>
    <item>
      <title>Read internet file with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204146#M1209196</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'm a new QV user. Maybe my question is trivial.&lt;/P&gt;&lt;P&gt;I want to read several files on the web with different name but with the same structure (web page)&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;http://www.parisavelo.net/detail-station-11001-b.htm&lt;/P&gt;&lt;P&gt;I know how to read this page.&lt;/P&gt;&lt;P&gt;To help me , I have an excel file with the name of all the files i want to read.&lt;/P&gt;&lt;P&gt;How can i make script to make a loop ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;Jean-Jacques&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 16:02:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204146#M1209196</guid>
      <dc:creator />
      <dc:date>2009-11-11T16:02:53Z</dc:date>
    </item>
    <item>
      <title>Read internet file with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204147#M1209197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jean-Jacques,&lt;/P&gt;&lt;P&gt;Basically what you can do is load all the values from Excel with the filenames into a field. Then you tell QlikView to count the values in the field. After this you loop as many times as there are values, pulling a new value from a new position every time and using that path to load from the specific html file.&lt;/P&gt;&lt;P&gt;This is written without testing in QlikView so there might be some syntax issues:&lt;/P&gt;&lt;P&gt;let vCounter = fieldvaluecount('ExcelFieldWithNames'); //Counting the values from the excel table&lt;/P&gt;&lt;P&gt;for i=1 to $(vCounter) //initiating the loop - as many times as there are values in excel&lt;/P&gt;&lt;P&gt;let vExcelFieldValue = FieldValue('ExcelFieldWithNames',$(i)); //pull the actual URL from position i in the excel file&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt; xxx,&lt;BR /&gt; yyy&lt;BR /&gt;from $(vExcelFieldValue); //Loading the table from the current URL&lt;/P&gt;&lt;P&gt;next //Moving to the next step where i increases by 1 until it finally hits the number of field values in the excel file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 16:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204147#M1209197</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-11T16:12:30Z</dc:date>
    </item>
    <item>
      <title>Read internet file with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204148#M1209198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Johannes for your help, it works fine (almost).&lt;/P&gt;&lt;P&gt;Just another point. What if the vExcelFieldValue doesn't exist (maybe the value is not synchronize with the URL). Is there a test to prevent the access ?&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jean-Jacques&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 16:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204148#M1209198</guid>
      <dc:creator />
      <dc:date>2009-11-11T16:52:09Z</dc:date>
    </item>
    <item>
      <title>Read internet file with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204149#M1209199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope I understand this correctly. You want some kind of error checking mechanism in place?&lt;/P&gt;&lt;P&gt;What you can do is:&lt;/P&gt;&lt;P&gt;let vCounter = fieldvaluecount('ExcelFieldWithNames'); &lt;EM&gt;//Counting the values from the excel table&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;for i=1 to $(vCounter) &lt;EM&gt;//initiating the loop - as many times as there are values in excel&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;let vExcelFieldValue = FieldValue('ExcelFieldWithNames',$(i)); &lt;EM&gt;//pull the actual URL from position i in the excel file&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;set ErrorMode = 0; &lt;EM&gt;//This tells QlikView not to halt on script errors like if the URL doesn't have the same table structure&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt; xxx,&lt;BR /&gt; yyy&lt;BR /&gt;from $(vExcelFieldValue); &lt;EM&gt;//Loading the table from the current URL&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;if ScriptError=11 then&lt;BR /&gt; &lt;EM&gt;//In here you can choose what to do if it's a ScriptError 11 for example, Field not found.&lt;BR /&gt;&lt;/EM&gt; end if&lt;/P&gt;&lt;P&gt;next &lt;EM&gt;//Moving to the next step where i increases by 1 until it finally hits the number of field values in the excel file&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;-----------&lt;BR /&gt;&lt;STRONG&gt;ScriptError codes:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1 No error&lt;BR /&gt;2 General Error&lt;BR /&gt;3 Syntax Error&lt;BR /&gt;4 General ODBC Error&lt;BR /&gt;5 General OLE DB Error&lt;BR /&gt;6 General XML Error&lt;BR /&gt;7 General HTML Error&lt;BR /&gt;8 File Not Found&lt;BR /&gt;9 Database Not Found&lt;BR /&gt;10 Table Not Found&lt;BR /&gt;11 Field Not Found&lt;BR /&gt;12 File Has Wrong Format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 17:29:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204149#M1209199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-11T17:29:21Z</dc:date>
    </item>
    <item>
      <title>Read internet file with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204150#M1209200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fine !&lt;/P&gt;&lt;P&gt;It' exactly what i want.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Jean-Jacques&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 17:32:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-internet-file-with-a-loop/m-p/204150#M1209200</guid>
      <dc:creator />
      <dc:date>2009-11-11T17:32:36Z</dc:date>
    </item>
  </channel>
</rss>

