Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ven6
Contributor III
Contributor III

extract the data from the AS400 and for each day recorded the data until the present day

Hello. I have a car database on the AS400.
here are some fields
model, date recording, historical
  I would like for each day from 2019-07-01 to today the car models with the most recent history.

Thank you

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

   I believe below job can help you to get results.

0683p000009M75x.png

 

The first stage is to identify the unique dates for situation column.

0683p000009M6l5.png

 

TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",row1.history)) 

0683p000009M747.png

 

Store the output of this data to a tHashOutput.

0683p000009M767.png

 

In the next stage, read the file again and join it with tHashInput.0683p000009M76C.png

 

TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",row4.history)) 

0683p000009M76H.png

 

0683p000009M6pG.png

 

And you got the answer! Please spare a second to mark the topic as resolved 🙂 Kudos will be a bonus!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post

5 Replies
Anonymous
Not applicable

Hi,

 

   Could you please share 10 sample input records (as text data) along with expected output?

 

   This will help us to understand more about your use case.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Ven6
Contributor III
Contributor III
Author

H,

this is my input

 

carName carModel history
A1 A 2019/08/19 07:00
A1 A 2019/08/19 07:50
A1 C 2019/08/20 10:00
A1 C 2019/08/20 10:01
B1 E 2019/08/19 07:04
B1 E 2019/08/19 07:02
B1 H 2019/08/20 08:00
B1 H 2019/08/20 09:00
E1 I 2019/08/21 07:00
E1 I 2019/08/21 10:00

 

I expect this in Output. Output is and mssql Database.

 

 

situation carName carModel history
2019/08/21 E1 I 2019/08/21 10:00
2019/08/20 A1 C 2019/08/20 10:01
  B1 H 2019/08/20 09:00
2019/08/19 A1 A 2019/08/19 07:50
  B1 E 2019/08/19 07:04

 

Anonymous
Not applicable

Hi,

 

   I believe below job can help you to get results.

0683p000009M75x.png

 

The first stage is to identify the unique dates for situation column.

0683p000009M6l5.png

 

TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",row1.history)) 

0683p000009M747.png

 

Store the output of this data to a tHashOutput.

0683p000009M767.png

 

In the next stage, read the file again and join it with tHashInput.0683p000009M76C.png

 

TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",row4.history)) 

0683p000009M76H.png

 

0683p000009M6pG.png

 

And you got the answer! Please spare a second to mark the topic as resolved 🙂 Kudos will be a bonus!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Ven6
Contributor III
Contributor III
Author

Hi tks for this answer

 

But, i have this Error Type mismatch: cannot convert string to date. The fields Date in AS400 is in the type Integer.

 

I thought it should have an iteration on the job because, the job by executing every day, the date of departure must be fixed against the end date must be incremented to the date of the day.

 

I thought it should have an iteration on the job because, the job by executing every day, the date of departure must be fixed against the end date must be incremented to the date of the day.
stp of help.

I would like every day that the job runs, the date is incremented to the current day and extracts the data transforms and loads.


pls help.

Anonymous
Not applicable

Hi,

 

    Please refer the below community post where the user has resolved similar issue.

 

https://www.talendforge.org/forum/viewtopic.php?id=7820

 

     I would recommend to create a separate post for any different issues so that we will not end up diluting the content of the original query. Could you also spare a second to mark the topic as resolved with the post having answer for your query?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved