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: 
Anonymous
Not applicable

File Extension

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

3 Replies
crusader_
Partner - Specialist
Partner - Specialist

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

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein