Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;
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.
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;
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.
🙂