Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi qlikview
I am loading some excel files in qlikivew. user giving the files format as sometime .XLS or .XLSX. Is it possible in QV code to make dynamic loading without changing the script every time
regards
Ramu
Hi,
Yes, use mask *.
LOAD Field1
, Field2
FROM YourFile.*
Please be aware that all file extensions will be considered to load for file with the same name.
HTH
Andrei
For a single known Excel file:
You could create two load statement. Set ErrorMode = 0, then perform the first load (using xls/biff). This will eaither succeed or fail silently. Check the error status or the loaded table to determine if it was successful. If it failed,then load the file using xlsx/ooxml.
Or you could use a structure like:
For Each vExt in 'xls', 'xlsx'
For Each vFile in FileList('*.$(vExt)')
If vExt = 'xls' Then
Table1:
LOAD ....
FROM [$(vFile)]
(biff, ....)
Else
Table1:
LOAD ....
FROM [$(vFile)]
(ooxml, ....)
End If
Next
Next