Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

saxofonoacn
New Contributor III

Looping data load

Hi guys,

I am trying to loop a data load into a qvd level; however having problems...

  • The data comes from .html files titles 2001.html to 2265.html but some are missing so all in all 187 HTML files. One is GDP, other one Population and so on...
  • I am trying to loop over "@[number]" tables where each @ is a new country (therefore F1 is "Country" field@) and F2 is a measure with data (say GDP). The number of tables @1, @2.... can go up to hundreds and I don't know at any point how many tables there are (as per pic below). @4 gives headings: Country, [names measure] (I am not interested in @1 to @3 but that's a detail).

Q1: how to do the loop so each country is loaded with all measures (from all files) and data for that measure.

Q2: data for the measure sometimes contains multiple figures for different years (see picture). Subfield () would be the obvious first thing to do here, but if you have any other/ better ideas, I am listening

2001.html give the following for GDP:

looping.PNG

2002.html gives Population growth in %:

looping_1.PNG

Thank you in advance!

1 Solution

Accepted Solutions

Re: Looping data load

Q1: Perhaps this discussion helps: know the number of tables

Q2: Subfield() looks logical. Perhaps Mid() could be used too if the strings are fixed length (including padding spaces).


talk is cheap, supply exceeds demand
2 Replies

Re: Looping data load

Q1: Perhaps this discussion helps: know the number of tables

Q2: Subfield() looks logical. Perhaps Mid() could be used too if the strings are fixed length (including padding spaces).


talk is cheap, supply exceeds demand
saxofonoacn
New Contributor III

Re: Looping data load

Thanks Gysbert Wassenaar. In addition, I created another loop but the main load is done more or less the way you suggested. Very helpful!!

Community Browser