Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

how to read xml files in a loop

hello

I got a QVW file

in the script I need to read 8000 xml files (all with the same structure)

i need to go to the folder path and read all xml files into qlikview

how can I accomplish this?

Please advise

I can walk on water when it freezes
11 Replies
Gysbert_Wassenaar

With something like this:

for each File in filelist ('C:\myxmls\*.xml')

Load* from $(File) (XmlSimple, Table is

);

next File


talk is cheap, supply exceeds demand
ali_hijazi
Partner - Master II
Partner - Master II
Author

I got an error saying that Load all(*) is not allowed in this file type

Please check attached sample file

I can walk on water when it freezes
Gysbert_Wassenaar

Use the wizard Web Files to create a load statement for that xml file.


talk is cheap, supply exceeds demand
ali_hijazi
Partner - Master II
Partner - Master II
Author

yes but I got one issue

I got 8000 xml files

some files of these might contain additional tags than others

I can walk on water when it freezes
christophebrault
Specialist
Specialist

Can you share sample ?

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Not applicable

Hi,

Do u want that additional tag as a field or not?

Regards,

Kabilan K.

ali_hijazi
Partner - Master II
Partner - Master II
Author

Yes check attached xml file in the beginning of the conversation

I can walk on water when it freezes
ali_hijazi
Partner - Master II
Partner - Master II
Author

yes some xml files may contain additional tags as fields

....

<fullName>Name of employee </fullName>

.....

another file may contain

....

<fullName>Name of employee </fullName>

.....

<newTag>new information</newTag>

I can walk on water when it freezes
Not applicable

Access the menu script and search for the file by the command "FILES TABLE", load only one file so that the structure QLIKVIEW read this file and create a map. If other files have different fields, add these fields using as reference the map created in the script.

Change the the file path excluding the file name and indicate only the destination folder of all files to be loaded with the expression \ *. Xml.

If the file contains more than one table that requires connection, using the file name to create a key between the tables:

FileName (FILE) as key.