Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save $300 - Register for QlikWorld (formerly Qonnections) by January 31st: Learn More
Partner
Partner

storing excel file name as a variable

How do I go about storing my excel file name into a variable in qlik sense?

I am going through a bunch of excel files that need conversion into qvd. Lets say my excel file name is "2019 File 1..", "2019 File 2..", etc.

I am trying to use this script below:


FOR vCount = 0 to NoOfTables()-1

LET vTableName = TableName($(vCount));

STORE $(vTableName) INTO 'lib://personalpath/$(vTableName).qvd' (qvd);

NEXT vCount

The variable vTableName wouldn't work since all of these workbooks have the same name - "Sheet1"

 

2 Replies
Highlighted
Partner
Partner

Re: storing excel file name as a variable

If all of the workbooks have same name, they are probably all concatenated to one table when loading. You need to add NoConcatenate after your load statement

Your storing script is fine

Partner
Partner

Re: storing excel file name as a variable

You should be able to use filename()

 

LET vFilename = FileName();