Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivbm88
Creator
Creator

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!

1 Solution

Accepted Solutions
mikaelsc
Specialist
Specialist

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

View solution in original post

7 Replies
petter
Partner - Champion III
Partner - Champion III

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

yanivbm88
Creator
Creator
Author

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.

petter
Partner - Champion III
Partner - Champion III

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
Creator
Creator
Author

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


petter
Partner - Champion III
Partner - Champion III

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
Specialist
Specialist

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

yanivbm88
Creator
Creator
Author

Thanks!