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: 
farolito20
Contributor III
Contributor III

Date in qvd

Hello!

I have a database, and I want to make a backup of it, so I'm using a .qvd files.

Now, I wanna save per data, the hour and date when I add it to my .qvd.

How can I add a new column to my qvd?

21 Replies
Miguel_Angel_Baeyens

Hi,

Use a variable with the timestamp then add it to the file name:

LET vTimestamp = Timestamp(Now(), 'YYYYMMDDhhmmss');

Data:

LOAD *

FROM Table;

STORE Data INTO [File$(vTimestamp).qvd] (qvd);

The result will be a QVD named File20121218153100.qvd

Hope that helps.

Miguel

farolito20
Contributor III
Contributor III
Author

My data will look like this:

ID, Name, date_modifed

001,Marina, 18/12/2012

Miguel_Angel_Baeyens

Hi,

I'd rather speak in English in the general forums, there is a Spanish speaking group where all threads en español are welcome.

So, I assume that the field you want to populate is the "date_modified" so a little change to the code above will work

LET vTimestamp = Timestamp(Now(), 'DD/MM/YYYY');

Data:
LOAD *,

     $(vTimestamp) AS date_modified
FROM Table;

Hope that helps.

Miguel

farolito20
Contributor III
Contributor III
Author

Ok, but this is the load... the $(vTimestamp) AS date_modified should not be in the store?

farolito20
Contributor III
Contributor III
Author

tabla1:

LOAD ID,

     Name,

     Age

FROM

prueba.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD ID,

           Name,

           Age

FROM bk2.qvd (qvd);

NoConcatenate

tabla2:

LOAD Distinct

          ID,

           Name,

           Age

Resident tabla1;

STORE tabla2 into bk2.qvd (qvd);

That's my code, I wanna add a column with a date when the new data would stored

Miguel_Angel_Baeyens

Hi,

As mentioned above:

LOAD ID,

     Name,

     Age

FROM

prueba.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD ID,

     Name,

     Age

FROM bk2.qvd (qvd);

LET vDateModified = Date(Now(), 'DD/MM/YYYY');

NoConcatenate

tabla2:

LOAD Distinct

     ID,

     Name,

     Age,

     $(vDateModified) AS date_modified // this field is new, will be stored into bk2.qvd

Resident tabla1;

STORE tabla2 into bk2.qvd (qvd);

Hope that helps.

Miguel

farolito20
Contributor III
Contributor III
Author

Every time that I reload my script, all data change the date

farolito20
Contributor III
Contributor III
Author

I jus wanna change de date of the new values added

Miguel_Angel_Baeyens

How do you identify those new values? What is the unique key? Is it possible that a value already exists in both existing and new records?

Miguel