Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

gerhardl
Contributor II

Load from Web

Hi there,

I've never loaded from the web before (didn't even see I could before now).

We have a website where we get daily Fax reports on - each report is available by clicking on the date from a list of all reports (see image).

If I do the following in QlikView it works fine:

LOAD *

FROM

[http://XXXXX.YYYY.com/faxapp/reports/full_fax_20121105.txt]

(txt, codepage is 1252, embedded labels, delimiter is '~', no quotes);

Usually, when pulling files from a folder, I would simply change the filename to full_fax_*.txt

and this will load all files.

But this is not working - I then get a "field not found" error when trying to load.

How can I load the entire list of reports on the site? They are alwaus name "full_fax_YYYYMMDD.txt"

Thanks,

Gerhard

Tags (1)
1 Solution

Accepted Solutions
vgutkovsky
Honored Contributor II

Re: Load from Web

Alternatively, since you know there is 1 file per day, you can just create a FOR loop and populate it with calendar days. To make sure it doesn't just error out when a day's files are missing, you would need to set the ErrorMode variable. So something like this:

SET ErrorMode = 0;

LET vFirstDate = num(date('01/01/2012')); //change this to anything you like
LET vLastDate = num(today());

FOR i='$(vFirstDate)' TO '$(vLastDate)'

    LET vDateVariable = date($(i),'YYYYMMDD');

    Data:

    LOAD * FROM

    [http://XXXXX.YYYY.com/faxapp/reports/full_fax_$(vDateVariable).txt]

    (txt, codepage is 1252, embedded labels, delimiter is '~', no quotes);

NEXT

SET ErrorMode = 1;

3 Replies
whiteline
Honored Contributor II

Re: Load from Web

Hi.

You cann't do it like with folders as in this case QV performs a standart http get request to the URI provided.

To load the list of files your website should return it.

Just paste the link that you used to take the screenshot to the load wizard in QV and check.

vgutkovsky
Honored Contributor II

Re: Load from Web

Alternatively, since you know there is 1 file per day, you can just create a FOR loop and populate it with calendar days. To make sure it doesn't just error out when a day's files are missing, you would need to set the ErrorMode variable. So something like this:

SET ErrorMode = 0;

LET vFirstDate = num(date('01/01/2012')); //change this to anything you like
LET vLastDate = num(today());

FOR i='$(vFirstDate)' TO '$(vLastDate)'

    LET vDateVariable = date($(i),'YYYYMMDD');

    Data:

    LOAD * FROM

    [http://XXXXX.YYYY.com/faxapp/reports/full_fax_$(vDateVariable).txt]

    (txt, codepage is 1252, embedded labels, delimiter is '~', no quotes);

NEXT

SET ErrorMode = 1;

gerhardl
Contributor II

Re: Load from Web

Perfect!

Works great, thank you... Now I want to figure out what it all means so I can learn to not ask here how to do everything.

Smiley Happy

Community Browser