Split dates group by Employee ID

Six Stars

Split dates group by Employee ID

Hello All,

I was trying few different data transformations on dates along with employee id data.

 

Before that, I was able to get the dates between start and end using below flow.

Screen Shot 2019-04-30 at 7.18.55 AM.png

 

tRowGenerator:- 

Screen Shot 2019-04-30 at 7.20.16 AM.png

 

tJavaRow:- 

Screen Shot 2019-04-30 at 7.20.57 AM.png

tJavaFlex:-

Screen Shot 2019-04-30 at 7.21.30 AM.png

The output that i am getting after this is:-

 

 

[statistics] connecting to socket on port 3520

[statistics] connected

30-04-2019|25-04-2019|25-04-2019

30-04-2019|25-04-2019|26-04-2019

30-04-2019|25-04-2019|27-04-2019

30-04-2019|25-04-2019|28-04-2019

30-04-2019|25-04-2019|29-04-2019

30-04-2019|25-04-2019|30-04-2019

[statistics] disconnected

 

Then i tried to do add emp id's to the same and my input data looks like below.

Data:- 

EmpID .       start                 end

128256 10/04/19 15/04/19
128257 15/04/19 25/04/19

 

The Output that iam expecting is:-

Screen Shot 2019-04-30 at 7.27.48 AM.png

 

I tried the same way as above flow,

But i couldnt get the output as i am expecting.

 

Output:-

[statistics] connected

For input string: "EmpID"

25-04-2019|15-04-2019|15-04-2019|128257

25-04-2019|15-04-2019|16-04-2019|128257

25-04-2019|15-04-2019|17-04-2019|128257

25-04-2019|15-04-2019|18-04-2019|128257

25-04-2019|15-04-2019|19-04-2019|128257

25-04-2019|15-04-2019|20-04-2019|128257

25-04-2019|15-04-2019|21-04-2019|128257

25-04-2019|15-04-2019|22-04-2019|128257

25-04-2019|15-04-2019|23-04-2019|128257

25-04-2019|15-04-2019|24-04-2019|128257

25-04-2019|15-04-2019|25-04-2019|128257

[statistics] disconnected

 

The dates are not getting differentiated by EmpID's

 

How can i get this.

 

Please help.

 

Thanks in Advance.

Mohan V.


Accepted Solutions
Community Manager

Re: Split dates group by Employee ID

Hi Mohan,
I think you need a tLoop component to achieve it, the job design looks like:
tFileInputDelimited--main-tFlowToIterate--iterate--tJava--oncomponentok--tLoop--iterate--tFixedFlowInput--main--tLogRow
on tJava: populate the number of days between startDate to endDates, this number will be the variable value of To parameter on tLoop component.

tFixedFlowInput: generate the current record.

Can you try and let me know if you need more help?

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post


All Replies
Community Manager

Re: Split dates group by Employee ID

Hi Mohan,
I think you need a tLoop component to achieve it, the job design looks like:
tFileInputDelimited--main-tFlowToIterate--iterate--tJava--oncomponentok--tLoop--iterate--tFixedFlowInput--main--tLogRow
on tJava: populate the number of days between startDate to endDates, this number will be the variable value of To parameter on tLoop component.

tFixedFlowInput: generate the current record.

Can you try and let me know if you need more help?

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post

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

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog