I have to make a report for vehicle orders. In every single xml-file there is one order for one vehicle.
The xml-files have to be processed in a loop and they all have the same structure and fields.
I have tested my coding with 3 xml-files and I get a correct result. However, the folder contains 1000 xml-files which have to be handled. After more than 100 files I get no response from QlikView, it seems that QlikView hangs or crashes.
The coding includes 3 load statements for the tables included in the xml-file which are linked by a join in my coding.
I have attached the coding, the table structure (reading 3 xml-files) and the result.
Is the coding incorrect or is it not possible to handle such a big number of xml-files?
Thank you for your help,
SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
for each FileExtension in 'xml'
for each FoundFile in filelist( Root & '\*.' & FileExtension)
LOAD [OrderSummary/TotalAmount/MonetaryValue/MonetaryAmount] as [TotalAmount/MonetaryValue/MonetaryAmount],
[OrderSummary/TotalAmount/MonetaryValue/Currency/CurrencyCoded] as [MonetaryValue/Currency/CurrencyCoded],
[OrderHeader/OrderIssueDate] as OrderIssueDate,
[OrderHeader/ReleaseNumber] as ReleaseNumber,
[OrderHeader/OrderHeaderNote] as OrderHeaderNote,
[OrderHeader/ListOfStructuredNote/StructuredNote/GeneralNote] as [StructuredNote/GeneralNote],
[OrderHeader/ListOfStructuredNote/StructuredNote/NoteID] as [StructuredNote/NoteID],
[OrderHeader/OrderPaymentInstructions/PaymentInstructions/PaymentMethod/PaymentMeanCoded] as PaymentMeanCoded,
[OrderHeader/OrderPaymentInstructions/PaymentInstructions/PaymentMethod/PaymentMeanCodedOther] as PaymentMeanCodedOther,
[OrderHeader/OrderPaymentInstructions/PaymentInstructions/PaymentTerms/PaymentTerm/PaymentTermCoded] as PaymentTermCoded,
[OrderHeader/OrderReferences/AccountCode/Reference/RefNum] as [AccountCode/Reference/RefNum],
[OrderHeader/OrderNumber/BuyerOrderNumber] as BuyerOrderNumber,
from [$(FoundFile)] (XmlSimple, Table is [Order]) ;
[DeliveryDetail/ListOfScheduleLine/ScheduleLine/RequestedDeliveryDate] as RequestedDeliveryDate,
[DeliveryDetail/ListOfScheduleLine/ScheduleLine/Quantity/QuantityValue] as [ScheduleLine/Quantity/QuantityValue],
[BaseItemDetail/LineItemType/LineItemTypeCoded] as LineItemTypeCoded,
[BaseItemDetail/LineItemType/LineItemTypeCodedOther] as LineItemTypeCodedOther,
[BaseItemDetail/LineItemNum/BuyerLineItemNum] as BuyerLineItemNum,
%Key_Order_A113820B1D524340, // Key to parent table: Order
%Key_ItemDetail_BD2A7FC403DB35C4 // Key for this table: Order/OrderDetail/ListOfItemDetail/ItemDetail
FROM [$(FoundFile)] (XmlSimple, Table is [Order/OrderDetail/ListOfItemDetail/ItemDetail])
WHERE [BaseItemDetail/LineItemNum/BuyerLineItemNum] = '00010';
%Key_ItemDetail_BD2A7FC403DB35C4 // Key to parent table: Order/OrderDetail/ListOfItemDetail/ItemDetail
FROM [$(FoundFile)] (XmlSimple, Table is [Order/OrderDetail/ListOfItemDetail/ItemDetail/BaseItemDetail/ListOfItemReferences/ListOfReferenceCoded/ReferenceCoded])
WHERE ReferenceTypeCoded = 'CustomersUnitInventoryNumber' ;
Call ScanFolder('D:\data\Qlik\INCOME_ORDERS') ;
Structure of the tables (when processing 3 xml files):