Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
saxofonoacn
Partner - Contributor III
Partner - 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!

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Partner - Contributor III
Partner - Contributor III
Author

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