Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
remyasujith17
Contributor III
Contributor III

Dynamically creating files

Hi,

I have a qvdfile, I want data from the qvd to be stored in to excel every day. So excel filename should be different every time when the script executes.

I tried this, but the file replaces the old file.

SET vTableName = 'PlannedCalls';

LET vMonthDay = now();

LET vFilename = 'PlannedCalls'&$(vMonthDay);

$(vTableName):

LOAD * from [..\filename.qvd] (qvd)

where ModifiedDate = today();

store $(vTableName) into ..\Data\Xls\$(vFilename).csv(txt);

drop table $(vTableName);

SET vFilename='';

1 Solution

Accepted Solutions
remyasujith17
Contributor III
Contributor III
Author

This works.

LET vTableName = 'PlannedCalls';

LET vDate= Date(Today(), 'DD-MM-YYY');

$(vTableName):

LOAD * from [filename.qvd] (qvd)

where ModifiedDate = today();

store $(vTableName) into ..\Data\Xls\filename_$(vDate).csv(txt);

drop table $(vTableName);

View solution in original post

2 Replies
olivierrobin
Specialist III
Specialist III

hello

it may be due to the default parameter of now()

see below :

now([ timer_mode])

Return data type: dual

 

now( 0) Returns the time when the last data load completed.

now( 1) l When used in a chart expression, this returns the time of the function call.

l When used in a load script, this returns the time of the function call in the current data

 

now( 2) Returns the time when the document was opened

remyasujith17
Contributor III
Contributor III
Author

This works.

LET vTableName = 'PlannedCalls';

LET vDate= Date(Today(), 'DD-MM-YYY');

$(vTableName):

LOAD * from [filename.qvd] (qvd)

where ModifiedDate = today();

store $(vTableName) into ..\Data\Xls\filename_$(vDate).csv(txt);

drop table $(vTableName);