Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
mateil91
New Contributor

Loading files from Sharepoint with wildcard

Hello,

While loading files from Sharepoint, it works fine if I specify the file, but if I put a wildcard, I get an error of "Bad Zip File".

Here's an example:

Capture.PNG

The commented FROM, works fine.

But if I try with the not commented FROM, I got the error.

So anyone know why is this happening, and how could I do to upload all the files from a folder, instead of specify every file?

According to a post I've found, I tried changing the path to: '\\theshare.Xcompany.com\Week 3\*.xlsm', but it didn't work.

Thank you very much in advance for your help.

EDIT: Title corrected.

9 Replies
Highlighted
MVP
MVP

Re: Uploading files from Sharepoint with wildcard

You're actually downloading and not uploading by using the LOAD ... FROM with a web-URL.... to be correct.

Wildcards are only supported in the FROM part if you are accessing a drive location and not when you are using the webfile feature (a URL).

So the way to go about it is that you can retrieve a SharePoint list of the files stored in the folder first and then you will have to create a loop in your load script to retrieve each of the files.

Highlighted
mateil91
New Contributor

Re: Uploading files from Sharepoint with wildcard

Hi Petter. Thank you very much for your answer and correction.

So regarding the list of the stored files, I had tried to do that as doing:

LOAD

     FileName()

FROM [...Path].

But obviously it didn't work because I had to use a wildcard in order to get all the filenames.

So now the question is, how could I do to retrieve a SharePoint list of the files stored?


Thank you very much

Highlighted
MVP
MVP

Re: Uploading files from Sharepoint with wildcard

Microsoft SharePoint API's have changed and evolved over time. Which SharePoint version are you interfacing with?

Highlighted
mateil91
New Contributor

Re: Uploading files from Sharepoint with wildcard

I'm working with the SharePoint 2010.

Highlighted

Re: Loading files from Sharepoint with wildcard

I don't thing the share point will support the wild card for file name...you need to use the loop method

Highlighted
mateil91
New Contributor

Re: Loading files from Sharepoint with wildcard

Great. But how can I do to obtain the names of all the files of the folder?

Highlighted

Re: Loading files from Sharepoint with wildcard

In the script , go for web files and use URL where the excels are stored ..select the html mode > to the right you will see the tables in the format @1 , @2 go through each you will get the list of list here and then based on this go for the loop and reduce


Hope this helps you

Highlighted
mateil91
New Contributor

Re: Loading files from Sharepoint with wildcard

Hey,

Thank you for your answer.

I tried this, but it appears to me this message:

paraQLIKVIEW FORO.PNG

Anyway, I also tried to replace the fields for @1, @2... like this:

Table:

LOAD 

@1,

@2

FROM [https://theshare.Xcompany.com/sites/*] (ooxml, embedded labels, header is 8 lines, table is [OA-Quality])

And it didn't work.

I also tried with:

Table:

LOAD 

A,

B

FROM [https://theshare.Xcompany.com/sites/*] (ooxml, embedded labels, header is 8 lines, table is [OA-Quality])

And also it doesn't work.

Thank you anyway for your answer.. and any other possible solution is welcome.

Highlighted
meashok07
New Contributor

Re: Loading files from Sharepoint with wildcard

Hi Mateil,

 

did you get an answer to this issue, i also had similar requirement , can you help?