Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

import data from HTML file

Hi Team,

I want to import data from a website say for example-http://updateox.com/india/state-wise-population-of-india-as-per-2011-census/

while reloading the QVW file, I am getting error Field not found, but when i recheck it the field name is already present on the website.

I have attached my load script screenshot and error msg screenshot.

Please help me out with a solution.

Regards

Priyanka

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: import data from HTML file

I did a quick test and it is actually a kind of bug... In HTML two or more consequtive spaces are really just one space. I noticed that the two fields [State  /UT Code] and [India/State  Union Territory #] har two consequtive spaces before respectively /UT and Union....

Just removing a single space in both of them let me load without error:

LOAD [State /UT Code],

     [India/State/ Union Territory #],

     Population,

     Males,

     Females,

     Percent

FROM

[...//updateox.com/india/state-wise-population-of-india-as-per-2011-census/]

(html, utf8, embedded labels, table is @1);

7 Replies
prieper
Honored Contributor II

Re: import data from HTML file

Seems if if there is a hidden row with the totals in this table ...

You may validate by executing LOAD * FROM .....

You may use a script like:

Data:

LOAD

     @1            AS [State  /UT Code],

     @2            AS [India/State/  Union Territory #],

     @3            AS Population,

     @4            AS Males,

     @5            AS Females,

     @6            AS Percent

FROM

[http://updateox.com/india/state-wise-population-of-india-as-per-2011-census/]

(html, codepage is 1252, no labels, table is @1)

WHERE RECNO() > 2;

HTH Peter

bestofwest
Contributor II

Re: import data from HTML file

Save the html page into your Desktop and try from there...

ramoncova06
Valued Contributor III

Re: import data from HTML file

switch the load to *

LOAD *

FROM

[http://updateox.com/india/state-wise-population-of-india-as-per-2011-census/]

(html, codepage is 1252, embedded labels, table is @1);

MVP
MVP

Re: import data from HTML file

Try this instead:

LOAD

     @1 AS [State /UT Code],

     @2 AS [India/State Union Territory #],

     @3 AS Population,

     @4 AS Males,

     @5 AS Females,

     @6 AS Percent

FROM

[http..........]

(html, utf8, no labels, table is @1);

Obviously QlikView isn't very fond of / in a column-name ... a bug maybe ...

Even this works well too:

LOAD

     *

FROM

[http..........]

(html, utf8, embedded labels, table is @1);

MVP
MVP

Re: import data from HTML file

I did a quick test and it is actually a kind of bug... In HTML two or more consequtive spaces are really just one space. I noticed that the two fields [State  /UT Code] and [India/State  Union Territory #] har two consequtive spaces before respectively /UT and Union....

Just removing a single space in both of them let me load without error:

LOAD [State /UT Code],

     [India/State/ Union Territory #],

     Population,

     Males,

     Females,

     Percent

FROM

[...//updateox.com/india/state-wise-population-of-india-as-per-2011-census/]

(html, utf8, embedded labels, table is @1);

bhagirath
Contributor III

Re: import data from HTML file

Hi Priya,

the webfile wizard is generating an extra space between state and /UT Code

as per your query it is like this

[State  /UT Code],

and i tried this [State /UT Code] . it did worked

see the attached Qvw file

Not applicable

Re: import data from HTML file

Agreed with Petter Skjolden. This one I tested and works fine. Attached is the QVW.

Community Browser