Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Import N file xls

Is it possible to create an import for script with N file excel with same column name but with different names?

Thank you

Labels (1)
1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Ciro,

If the format of the files are identical it is very simple.

You can use a wildcard in the filename, like this:

LOAD

  *

FROM [..\Data\Accounts\Accounts-20*.xls]

(biff, embedded labels, header is 1 lines, table is [Billable Items$]);

Or, to make things more robust, you can do a loop:

for each vFile in FileList('..\Data\Accounts\Accounts-20*.xls')

    LOAD

      *

    FROM [$(vFile)]

    (biff, embedded labels, header is 1 lines, table is [Billable Items$]);

next

In both cases you can pick up the actual file name by using the filename funciton...

LOAD
  filename() as [Source File],

   *

FROM ...

Hope that helps.

Steve

View solution in original post

1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Ciro,

If the format of the files are identical it is very simple.

You can use a wildcard in the filename, like this:

LOAD

  *

FROM [..\Data\Accounts\Accounts-20*.xls]

(biff, embedded labels, header is 1 lines, table is [Billable Items$]);

Or, to make things more robust, you can do a loop:

for each vFile in FileList('..\Data\Accounts\Accounts-20*.xls')

    LOAD

      *

    FROM [$(vFile)]

    (biff, embedded labels, header is 1 lines, table is [Billable Items$]);

next

In both cases you can pick up the actual file name by using the filename funciton...

LOAD
  filename() as [Source File],

   *

FROM ...

Hope that helps.

Steve