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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

multiply the rows with dates

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

Labels (3)
25 Replies
fdenis
Master
Master

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 ?

Anonymous
Not applicable
Author

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


Screenshot from 2018-10-03 15-55-57.png
fdenis
Master
Master

look at your data. you have just one date and non unique ip
Anonymous
Not applicable
Author

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

fdenis
Master
Master

so add all date input fields to the output. add tLod (table mode) on the output
go step by step
add integer column with compareDate(row15.finished_Timestamp, row13.finished_Timestamp) is it the result you are expected?
Anonymous
Not applicable
Author

I think I know where I was wrong. Appreciate a lot for your help fdenis