Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dreweezy
Partner - Creator II
Partner - Creator II

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
DavidM
Partner - Creator II
Partner - Creator II

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

wcilliers
Partner Ambassador
Partner Ambassador

You should be able to use filename()

 

LET vFilename = FileName();