Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ashwanin
Specialist
Specialist

xml file

Hi Qlik Users,

I required the latest XML file from a folder (abc) and want to put the data in a QVD.


But i am facing  problem with the part Highlighted in bold underline below (in script)

Error which i am getting : Load all (*) is not allowed in this file type

Please tell me what i am doing wrong and how to rectify that.

Thanks in advance

set folder = "abc"

;

for each file in filelist('$(folder)\*.xml')

FileInfo:

Load

Distinct

FileName() as file_name,

FileBaseName() as file_base_name,

FilePath() as file_path,

FileTime() as file_time

from

$(file)

(XmlSimple, Table is [entries/entry]);

;

next file

Qualify *

;

LatestFiles:

First(1)

Load *

resident FileInfo

order by file_time DESC

;

Drop Table FileInfo

;

UNQUALIFY *

;

Let source = fieldname(3, 'LatestFiles')

;

Let source_i = fieldvalue('$(source)',1)

;

For i = 1 to NoofRows('LatestFiles')

[File$(i)]:

Load *,

'$(source_i)' as $(source)

from

$(source_i)

(XmlSimple, Table is [entries/entry]) ;

Let source_i = fieldvalue('$(source)',$(i)+1)

;

next i

exit script

;

1 Solution

Accepted Solutions
Gysbert_Wassenaar

That's right. When you load data from an xml file you have to specify all the field names explicitly. The * is not allowed for loads from xml files.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

That's right. When you load data from an xml file you have to specify all the field names explicitly. The * is not allowed for loads from xml files.


talk is cheap, supply exceeds demand
ashwanin
Specialist
Specialist
Author

Thanks Gysbert. You are genious.