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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
gt0731
Contributor III
Contributor III

How to get last modified date for row in tmap

Hi everyone , 

We have two column in our data model . that is 

LAST_UPDATE_TIME =  calculate only when row get updated in tmap 
CREATE_DATE = only When row get inserted first time in tmap

 

How do i  calculate these column for each of my table at tmap.

if there is any better alternatives using talend, kindly share the process 

 

Any help on this would be much appreciated

 

 

 

 

Labels (2)
4 Replies
David_Beaty
Specialist
Specialist

Hi,

First of all, if LAST_UPDATE_TIME is null, then you know it's CREATE_DATE.

If both columns are populated, then I'd suggest you use the Talend routine TalendDate with a methof of compareDate().

 

Have a look at this link

 

Anonymous
Not applicable

Hi @gt0731 ,

 

I believe you have two different flows from a tMap one for update and another for insert.

 

If not, you can create two different flows, and whenever you insert the Update Date column will be null and whenever you update the Update column will hold the value of current TimeStamp.

 

In the update flow, no need to provide the Create date column, you can chose your keys, based on which you will insert/update.

 

Thanks and Regards,

Subhadip

gt0731
Contributor III
Contributor III
Author

No, We do not have 2 flows for insert and update.

we use one flow only and based on key matching rows and in target selecting action - insert or update.

 

-How do we maintain  Last_update_time  timestamp column here.

 

Any help on it would be much appreciated ?

Anonymous
Not applicable

Hi @gt0731 ,

 

In this case, you should lookup with your target table with the keys in tMap.

 

Whenever keys are not present in the table, that means it is insert only so Update Timestamp is Null.

 

Whenever keys are present, the Update Timestamp should be Current Timestamp.

 

This logic you can write in tMap(if else condition based on key presence).

 

Best way would be to have two flows for insert and update.

 

Thanks and Regards,

Subhadip