Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I am very new to Qlik Sense. Any help on the below would be highly appreciated.
I am trying to upload a specific variable from multiple XML files. Please note the variable in question in all files has the same heading as listed in the script. The script has worked before, so have no clue why this error is being generated only now.
The attached pic shows the error being generated.
Below is the script. Thanks
SET ZLoadDirectory = '[lib://Qlik_ExtractsForLoading/]';
SUB LoadDirectory (ZLoadDirectory)
FOR each Repository in 'TR_1', 'TR_2', 'TR_3', 'TR_4', 'TR_5'
FOR each File in filelist (ZLoadDirectory & '$(Repository)' & '.xml')
//TRACE $(File)
[TR]:
Load
FileName() as fileName,
[New/CmonTradData/TxData/UnqTradIdr] AS UTI
From [$(File)]
(xml, embedded labels, table is [BizData/Pyld/Document/EMIRTradRpt/TradData/Rpt/Tx])
Where Len([New/CmonTradData/TxData/UnqTradIdr]) > 0;
NEXT File
NEXT Repository
FOR each Dir in dirlist (ZLoadDirectory&'\*')
CALL LoadDirectory(Dir)
NEXT Dir
END SUB
CALL LoadDirectory (ZLoadDirectory)
I don't see any pic attached... can you reattach the picture of the error?
Here it is.
This error came up after 51 minutes... my guess is that may be one of the files have an extra space or mis-spelling for the field name.... I am not sure what would be an easy way, but you can try to run the script in different batches of XML file to see which one gives this error.
I have tried removing some xml files, and left only 2 out of the original 5. For these 2 I checked the exact field name in each by loading them separately using the "add data" wizard. Field name seems to be correct for both files.
Error still generated, after 20 minutes of loading. Any clues? Could it be something related to the back-up files that Qlik might generate in the PC's system?
These are screenshots when you are still adding these files... what happens when they show on the script? Add them and check if you see any extra spaces in one of the two scripts for that particular field name....
Could it be something related to the back-up files that Qlik might generate in the PC's system?
I am not sure about this... have not worked with Qlik Sense a lot to answer this
I finally realised what the problem was! It had nothing to do with the variable names. The type of file in the script should read "XmlSimple" and not "xml". Therefore, the "from" bit of the script should be:
... From [$(File)]
(XmlSimple, embedded labels, table is [BizData/Pyld/Document/EMIRTradRpt/TradData/Rpt/Tx])
Where Len([New/CmonTradData/TxData/UnqTradIdr]) > 0; ....
Thanks Sunny for the help just the same
Awesome, I am glad you finally found your issue