Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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='';
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);
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
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);