Five Stars

Data of the last 3 months

Hello everybody,

 

I'm starting with talend and I have some problems. My current job looks like this:

My_Job.PNG

I want to extract a list of entries from wordpress via rest API. Every entry includes several value pairs. One of them is the created_date(timestamp). The job works so far. But I only want the entries of the last three month. The start- and end-timestamp should be dynamic. So every time when the job is running, the entries which are part of the job, should be created in the last three month in wordpress (depending on the start-timestamp of the job).

And there's one more thing. Every entry has a unique ID. But in the datasource you found some ID's with several entries. And I only want the entry with the latest created_date (timestamp) for each  unique ID. I know this is a lot... But I don't find a solution so far.

Maybe someone can help me with the first or second issue.

 

best regards,

Christian

1 ACCEPTED SOLUTION

Accepted Solutions
Eleven Stars

Re: Data of the last 3 months

Take a look at the routines.TalendDate routines. These will help you derive your to and from dates based on when you run the job. You will need to be able to use some Java for this. 

 

For your second question, you can use the tAggregateRow and tSort components to help you with this. Sort your data by id and date, then group by the id and date, then just select the LAST article within that group. 

Rilhia Solutions
2 REPLIES
Eleven Stars

Re: Data of the last 3 months

Take a look at the routines.TalendDate routines. These will help you derive your to and from dates based on when you run the job. You will need to be able to use some Java for this. 

 

For your second question, you can use the tAggregateRow and tSort components to help you with this. Sort your data by id and date, then group by the id and date, then just select the LAST article within that group. 

Rilhia Solutions
Five Stars

Re: Data of the last 3 months

Thank youSmiley Wink