Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone. I'm new with talend open studio . I have some trouble when using it. Is there any way to I can get my expected output from this input?
INPUT
DATE (yyyymmdd) | ip | FINISHED ( 1:finished; 0: not finish)
2017-01-01 | 111 | 1
2017-01-01 | 222 | 1
2017-01-02 | 333 | 1
2017-01-03 | 444 | 1
EXPECTED OUTPUT
DATE (yyyymmdd) | ip | FINISHED ( 1:finished; 0: not finish)
2017-01-01 | 111 | 1
2017-01-01 | 222 | 1
2017-01-01 | 333 | 0
2017-01-01 | 444 | 0
2017-01-02 | 111 | 1
2017-01-02 | 222 | 1
2017-01-02 | 333 | 1
2017-01-02 | 444 | 0
2017-01-03 | 111 | 1
2017-01-03 | 222 | 1
2017-01-03 | 333 | 1
2017-01-03 | 444 | 1
Can someone show me the way to do it?
Your help is very much appreciated.
Regards,
Thang
if I get your sample
DATE (yyyymmdd) | ip | FINISHED ( 1:finished; 0: not finish)
2017-01-01 | 111 | 1
2017-01-01 | 222 | 1
2017-01-02 | 333 | 1
2017-01-03 | 444 | 1
first step:
from input get distinct date (tMap+tAggregate) store in file:
DATE
2017-01-01
2017-01-02
2017-01-03
second step:
from input get ip (tMap) store in file:
ip
111
222
333
444
step 3:
use tmatch (all matches)
to retrieve all key
DATE (yyyymmdd) | ip
2017-01-01 | 111
2017-01-01 | 222
2017-01-01 | 333
2017-01-01 | 444
2017-01-02 | 111
2017-01-02 | 222
2017-01-02 | 333
2017-01-02 | 444
2017-01-03 | 111
2017-01-03 | 222
2017-01-03 | 333
2017-01-03 | 444
step 4
use tmap to link on ip with input
and check if date is after then finiched =1
where are you check your result ?
hi fdenis
That's what I'm talking about. I still get confused with where I should put the check my Finished which is fit or not.
Like you said before I put in tmap, I link the main of the tmap which I used is the date and the others are in look up . I could do to this step but the step link get a lot of confused because the condition in the output you wrote before require the row 15 has a date
hi fdenis,
I can refresh to the step hoan_thanh output and write this code (compareDate(row15.finished_Timestamp, row13.finished_Timestamp)>0)?"1":"0" after linked the row13 and row14 to row15 like you said. However, the code didn't work because row15.finished_timestamp is in the tmap look up so all data in the row finished of the output are "0"
I just get confused in this step. All before of your instruction is very helpful
I think I know where I was wrong. Appreciate a lot for your help fdenis