Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Date Value in a Variable

Hi,

I want to set a sysdate in a variable so that I can concat that variable with some prefix strings as a filename on qvd generation ?

Please suggest me idea on how to do that ?


Regards,

Sachin A.

12 Replies
Not applicable
Author

Hi,

Use today()

Not applicable
Author

Hi a.medina,

Please look the following the script..

SET ThousandSep=',';

.

.

.

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

SET vDate = today();

LoadFirst:

LOAD Serial,

     Value

FROM

[.\DemoTable.xlsx]

(ooxml, embedded labels, table is Sheet1);

-----------------------------------------------------------------------------------------------------

Now I want to save the table in LoadFirst Section into a QVD file, whose name will be like this..

QVD_vDate.qvd

I want to use that value in qvd name creation..

How to achieve this ?

Thanks...

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

The variable is wrong, you need LET not SET:

Let vDate = Today();

then you can enter $() like this:

Store LoadFirst Into QVD_$(vDate).qvd;

Not applicable
Author

Hi Sachin,

Do like this

STORE * FROM LoadFirst INTO LoadFirst_$(vDate).QVD;

Not applicable
Author

Hi,

Its works.

Store * from LoadFirst into .\QVD_$(vDate).qvd

Thanks

...

Will you please tell me how to drop a QVD created on (today()-1) day automatically ?

Not applicable
Author

if you want to drop the table

After storing just use this syntax for the table you used

DROP TABLE LoadFirst;

Not applicable
Author

Hi Sravan,

I want to drop/delete QVD from Script, is that possible ? Table dropping can be done but i m not sure about qvd.

Thanks.

Not applicable
Author

Sachin you have already stored the QVD in the directory where your .qvw is present.

when you have already stored it, I dont know now what you mean by deleting the QVD. you can do it manually if you dont want it.

Not applicable
Author

No mate. See.. I just took an example , In real scenarios, lots of qvd will create on the daily basis with a retention period of X days so, I want to delete already created qvd files which croses the X days of retention automatically.. Did you get my point ?