Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
farolito20
Contributor III
Contributor III

HELP

is it really necessary have a history table to trace back everything?

7 Replies
Anonymous
Not applicable

Doesn't look like a QV question.

Anyway, if you want to know what happened last week or last year, it should be stored somewhere.

Regards,

Michael

farolito20
Contributor III
Contributor III
Author

I have another question.

How I can save the modified data in a table .qvd?

For example, I have an employees_info table and I modified a phone number, but I wanna keep the other number because probably it's ussefull to make an report using old data.

id_employee , name, phone

001, carlos, 4556122


id_employee , name, phone

001, carlos, 9856741


Anonymous
Not applicable

I would keep both old record and new record in the QVD, and add one more field - date of phone change.

Regards,

Michael

farolito20
Contributor III
Contributor III
Author

But how?

Do you have the script?

I have this and don't work. I attached the error windowerror.jpg

Let ThisExecTime = ReloadTime();

QV_Table:

LOAD BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid;

SQL SELECT BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid

FROM AdventureWorks2008.Person.Password

WHERE ModifiedDate >= #$(LastExecTime)#;

Concatenate LOAD BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid FROM File.qvd (qvd);

 

STORE QV_Table INTO QV_Table.qvd (qvd);

Let LastExecTime = ThisExecTime;

Anonymous
Not applicable

Not sure why you use #$(LastExecTime)#.  Try to replace # with the singe quotes (assuming it is SQL Server database):

WHERE ModifiedDate >= '$(LastExecTime)';

Regards,

Michael

farolito20
Contributor III
Contributor III
Author

Now, I have this errorerror2.jpg

flipside
Partner - Specialist II
Partner - Specialist II

In your script, you will probably have the TimeStampFormat set, and this controls the date and time format of ReloadTime().  The error message you now see is being generated by SQL Server - it cannot understand this format, so you need to re-format the submitted string so SQL can understand it.

flipside