Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

farolito20
New 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

Re: Date in qvd

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
New Contributor III

Re: Date in qvd

My data will look like this:

ID, Name, date_modifed

001,Marina, 18/12/2012

Re: Date in qvd

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
New Contributor III

Re: Date in qvd

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

farolito20
New Contributor III

Re: Date in qvd

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

Re: Date in qvd

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
New Contributor III

Re: Date in qvd

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

farolito20
New Contributor III

Re: Date in qvd

I jus wanna change de date of the new values added

Re: Date in qvd

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