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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator III
Creator III

Web-file: Connector error: badPath

Hello, I would like to download a file from a "dynamic" URL every year.

I created a dataconnection for this:

IDENTIFICATION
Name: Feiertage
Connection String: https://www.feiertage.net/csvfile.php?state=NW&year=2021&type=csv  
Type: Internet

With this URL I can download the holidays for 2021. The link also works.

But because I don't want the year 2021 to be static, but always the current year, I convert the URL in the load script.

vURL = 'https://www.feiertage.net/csvfile.php?state=NW&year=';
vaktuellesJahr = Year(Date(Today()));
vType = '&type=csv';

NoConcatenate
TMP1:
Load
 Tag
,Year(Date(Tag)) as Feiertag_Jahr
,Feiertage
,Bundesland
From [lib://Feiertage]
(url is [$(vRoot)$(vaktuellesJahr)$(vType)], txt, codepage is 28591, embedded labels, delimiter is ';', msq);

With "(URL is...)" I change the URL and insert the current year (vaktuellesJahr).

When I load the data afterwards, I get the following error message:

Cannot open file: 'https://www.feiertage.net/csvfile.php?state=NW&year=2023&type=csv' (Connector error: badPath)

But the path is correct. If I copy this out of the error message, I can download the file without any problems.

How can help me, please?

Labels (4)
1 Solution

Accepted Solutions
sandeep-singh
Creator II
Creator II

Hi @reporting_neu, I am using Qliksense cloud and unable to find the web connector in my data connection. I tried to achieve it through the REST API.

to create a REST API connection I used this Connection String: https://www.feiertage.net/csvfile.php?state=NW&year=2021&type=csv.

Year will be dynamically changed once connection is established.

set vURL = 'https://www.feiertage.net/csvfile.php?state=NW&year=';
let vaktuellesJahr = Year(Date(Today(1)));
set vType = '&type=csv';

LIB CONNECT TO 'Feiertage';
TMP1:
Load
Tag
,Year(Date#(Tag,'DD.MM.YYYY')) as Feiertag_Jahr
,[ Feiertage] as Feiertage
,[ Bundesland] as Bundesland
;

SQL SELECT
"Tag",
" Feiertage",
" Bundesland"
FROM CSV (header on, delimiter ";", quote """") "CSV_source"
WITH CONNECTION
(
URL "$(vURL)$(vaktuellesJahr)$(vType)"
)
;

View solution in original post

2 Replies
sandeep-singh
Creator II
Creator II

Hi @reporting_neu, I am using Qliksense cloud and unable to find the web connector in my data connection. I tried to achieve it through the REST API.

to create a REST API connection I used this Connection String: https://www.feiertage.net/csvfile.php?state=NW&year=2021&type=csv.

Year will be dynamically changed once connection is established.

set vURL = 'https://www.feiertage.net/csvfile.php?state=NW&year=';
let vaktuellesJahr = Year(Date(Today(1)));
set vType = '&type=csv';

LIB CONNECT TO 'Feiertage';
TMP1:
Load
Tag
,Year(Date#(Tag,'DD.MM.YYYY')) as Feiertag_Jahr
,[ Feiertage] as Feiertage
,[ Bundesland] as Bundesland
;

SQL SELECT
"Tag",
" Feiertage",
" Bundesland"
FROM CSV (header on, delimiter ";", quote """") "CSV_source"
WITH CONNECTION
(
URL "$(vURL)$(vaktuellesJahr)$(vType)"
)
;

reporting_neu
Creator III
Creator III
Author

Perfect! Thank you so much! 🙂