Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Diana_B
Contributor II
Contributor II

Store table into Excel file with variable for timestamp

Hi all,

in my QlikView script I want to store a table as .csv file.
Later in my script I want to reload all stored files.
Therefore each stored file must have a distinct filename.

To solve this problem I set a variable with the timestamp (now()). As the script runs twice a day date(today()) doesn't work as variable because the first file stored at that day would be overwritten with the second run of the script.

It was possible to store the file as I set date(today()) as variable:

LET vDate = Date(today(1), 'DD-MM-YYYY');
store BelegungBesetzung_Store into \\...\StoreTabellen\$(vDate)_BelegungBesetzung.csv (txt);

But as I mentioned I need the time in the filename as well.

Therefore I tried the following:
1)

LET vTime = now();
store BelegungBesetzung_Store into \\...\StoreTabellen\$(vTime)_BelegungBesetzung.csv (txt);


2)

LET vTime = Timestamp(Now(),'DD-MM-YYYY hh:mm:ss');
store BelegungBesetzung_Store into \\...\StoreTabellen\$(vTime)_BelegungBesetzung.csv (txt);

Both of them didn't work and the following error message was shown:

File not found error

Cannot open file: '\\...Store Tabellen\03.02.2022 10:44: 51_BelegungBesetzung.csv'
System error: Failed to open file in write mode for file \\...Store Tabellen\03.02.2022 10:44: 51_BelegungBesetzung.csv


Again: I need to store the table into a csv-file but everytime with a different name. I thought a timestamp works for this, but maybe it can also be solved differently.

Can anyone please help me with this problem?

Thank you in advance!

Best regards
Diana

Labels (1)
1 Solution

Accepted Solutions
cwolf
Creator III
Creator III

Colons are not allowed in filenames! Therefore try for example:

LET vTime = Timestamp(Now(),'DD-MM-YYYY hhmmss');

View solution in original post

4 Replies
anat
Master
Master

Diana_B
Contributor II
Contributor II
Author

Hi @anat,

thanks for your reply!

I already tried this before I posted my question in this forum, but unfortunately it didn't work.
Do you have another idea how to solve my problem?

cwolf
Creator III
Creator III

Colons are not allowed in filenames! Therefore try for example:

LET vTime = Timestamp(Now(),'DD-MM-YYYY hhmmss');

Diana_B
Contributor II
Contributor II
Author

Hi @cwolf ,

OMG you are so right!

Thank you! Now of course it workes perfectly 🙂