Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
gopikrishnan06
Creator
Creator

Qlik replicate Issue for Insert and Update scenario

Hi team, 

Adding new column as add column as audit created datetime for insert, Audit updated datetime for the update.

When ever i get the insert command then it need to change the audit created date time. When ever i get the update command it change the audit updated date time.

But here it not working.. When i get insert or update it change the audit created date time alone..

Code: 

Audit created date time i used.

Column 'audit_created_datetime', data type DATETIME(6)
        Value: $AR_H_TIMESTAMP

 

Audit updated Date time i used

Add column
	for %.%
	Column 'audit_last_updated_datetime', data type DATETIME(6)
        Value: datetime('now', 'UTC')

 Kindly confirm the best one..

Whenever i need to get insert the current timestamp need to get it..

whenever i need to get update the current timestamp need to get it..

 

Labels (1)
20 Replies
gopikrishnan06
Creator
Creator
Author

Hi John,

Tired with several ways but nothing work on it for the Update scenario.. Finally moving with the target look up concept.

In a table we have 1 col as PK and few tables have more composite Key.. 

Need to add for 1PK alone the target look up.

Kindly confirm..

john_wang
Support
Support

Hello @gopikrishnan06 ,

The Lookup() function requires a primary key or unique index; otherwise, it performs a full table scan, which can impact the entire database and significantly degrade lookup performance.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
gopikrishnan06
Creator
Creator
Author

Hi John,

As per Target look up i applied in the column edit but it still not working..

Today i got first update again it make Null the Insert col as Audit created date time..

CASE
WHEN $AR_H_OPERATION = 'INSERT' then
datetime('now')
ELSE
target_lookup('NO_CACHING','qlik_1','JJJJ','audit_created_datetime','aa=:',$aa,'bb=:', $bb)
END

 

Again the update issues alone facing kindly check and do the needful..

john_wang
Support
Support

Hello @gopikrishnan06 ,

We recommend that you open a support ticket and engage the PS team to help move the project forward smoothly.

Hope this helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
gopikrishnan06
Creator
Creator
Author

Hi John,

what ever the said option have referred it was not working.. 

So i am checking in the Qlik forums and fix for it.. But here the Target loop up tired with the inserts and Updates too. 

This time it changing the inserted ie audit created datetime timestamp to latest. Actual we need only updated datetime for an update.

narendersarva
Support
Support

Hi @gopikrishnan06 

As John recommended, please open a Qlik support ticket to look into this further.

 

Thanks
Naren

gopikrishnan06
Creator
Creator
Author

Hi TEam,

 

Raised Support case how long it will going to test by the support team.. So immediate help so i asked in Forums. But here no scripts are working for the updated columns.

Dana_Baldwin
Support
Support

Hi @gopikrishnan06 

I found your support case and updated it from severity 3 to severity 2. I see we requested a diagnostics package on 10/22 that we have not yet received but need before the case can move forward. Please update the case with that.

Thanks,

Dana

gopikrishnan06
Creator
Creator
Author

hi Dana,

DPackages already updated.. I am facing in update scenario alone... it got updated as fine.. but issue with it changing the inserted datetime as audit created date

Dana_Baldwin
Support
Support

Thanks @gopikrishnan06 I see you updated the case. It is being reassigned to the next available support engineer. The case is being handled in IST hours. In case you need to escalate please refer to: How to escalate a support case - Qlik Community - 1713475

Thanks,

Dana