Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

yanivbm88
New Contributor III

Store with variable file name (CSV)

Hi All,

I try to save to a CSV file using STORE command with a variable in the file name.

I get the variable name $(vText) in the file name, like this: Test_$(vText).csv

Here is my script, I narrowed it down to be the least complicated possible:

Let vText= 'SomeText';
InventoryDailyReport:
LOAD
    TransactionType,
    DateThisReportGenerated,
    InventoryAsOfDate,
    InventoryAsOfTime,
    PlantCode
FROM [lib://Microsemi EDI_Schema (win-n5h9rv84sq3_administrator)/InventoryDailyReport_Temp2.qvd](qvd);
   
Store InventoryDailyReport into lib://CSV/Test_$(vText).csv(txt, delimiter is '|');

I looked through many posts regarding this issue, without success.

Any suggestions?

Thanks!

Tags (3)
1 Solution

Accepted Solutions
mikaelsc
Contributor III

Re: Store with variable file name (CSV)

enquote "lib://CSV/Test_$(vText).csv"

7 Replies
MVP
MVP

Re: Store with variable file name (CSV)

Do you have a data connection to a folder defined that is named CSV? Does it point to a valid folder location?

yanivbm88
New Contributor III

Re: Store with variable file name (CSV)

Hi Peter,

Yes, I do. The file is saved in the requested folder, the issue is with the file name which is incorrect and relates to '$(vTest)' as Text.

MVP
MVP

Re: Store with variable file name (CSV)

What do you mean then? Do you get an error message when you run the load script or do it store it with a file name that looks like 'Test_(vText).csv' literally without doing the $-sign expansion?

yanivbm88
New Contributor III

Re: Store with variable file name (CSV)

I want to have the value of the vTest variable in the file name. I don't get any error, just the file name is wrong.

The wrong file name (What I get): Test_$(vText).csv


Requested file name:  Test_SomeText.csv


MVP
MVP

Re: Store with variable file name (CSV)

I tested it in my Qlik Sense Desktop and it works perfectly fine for me.

What is the version of Qlik Sense you are using? Qlik Sense Desktop or Qlik Sense Enterprise and the release number?

mikaelsc
Contributor III

Re: Store with variable file name (CSV)

enquote "lib://CSV/Test_$(vText).csv"

yanivbm88
New Contributor III

Re: Store with variable file name (CSV)

Thanks!