Get updated date through tMap

Highlighted
Six Stars

Get updated date through tMap

Hi,

 

Can you please advise me how to get the highlighted data through tMap coding?

For the same PO, the source report contains multiple records. the highlighted one is the latest one which I need for the result.

For now I do not have any idea to achieve this.

 

Thanks for the help!

 

Capture.JPG

Eleven Stars

Re: Get updated date through tMap

you could you tsort before going to tmap so that latest is at top , then if you doing lookup innerjoin user first match
Regards
Abhishek KUMAR
Forteen Stars

Re: Get updated date through tMap

better to use tAggregateRow

 

of course you can store data to tHashOutput and then use in tMap for join with all data (if you need this)

-----------
Six Stars

Re: Get updated date through tMap

Hi,

 

Thank you for the reply. I have tried using tSortRow to DESC the date. But then I got reverse dates.  

The flow I created is below as well - not sure which part has problem. tMap_1 is used to transfer "String" to "Date" data type. Then I sorted both ETD and ETA DESC. the second tMap is used to do the logic for my task.
Capture.JPG

Capture.JPG

Eleven Stars

Re: Get updated date through tMap

Hello ,

 

I took below as input 

 

2/19/2019;2/21/2019;A
2/05/2019;3/21/2019;A
2/19/2019;3/21/2019;A
2/19/2019;2/21/2019;B
2/05/2019;3/21/2019;B
2/19/2019;3/21/2019;B

 

read file (while reading you could read it as Date with pattern MM/dd/yyyy) --> tsort (on 2nd col desc then 1st col desc then 3rd col) --> tsamplerow ( for test -to get 1st 2 record) --> tLogrow

TalendSolution_5.JPG

 

i got this as output

2/19/2019;3/21/2019;A

2/19/2019;3/21/2019;B

 

But if you are not doing any lookup in tMap( 3rd column) after tsortRow , better to go with tAggregateRow/tAggregateSortedRow.

 

 

 

Regards
Abhishek KUMAR

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download