If you are working as Talend ETL guy then you have to do some kinds of jobs in Talend which can be easily achieved in database end like in SQL Server. One of them is just Rolling or Cumulative sum also. Talend is full of many mind-blowing components which are fully capable to accomplished of any kind of jobs.
Here you will learn "How to create a rolling or cumulative sum over different groups by using tJavaFlex ?" in Talend Open Studio.
We will use the following components -
tFileInputDelimated: We can use this component to read a file and separate fields contained in this file using a defined separator. It allows you to create a data flow.
tLogRow: This component is used to monitor data processed and displays data or results in the Run console. This component can be used as intermediate step in a data flow or as a n end object in the Job flowchart.
SalesPersonId
|
SalesYear
|
TotalSales
|
201
|
2015
|
100
|
202
|
2015
|
200
|
203
|
2015
|
300
|
204
|
2015
|
400
|
205
|
2016
|
50
|
206
|
2016
|
100
|
207
|
2016
|
150
|
208
|
2016
|
200
|
209
|
2017
|
1000
|
210
|
2017
|
2000
|
211
|
2017
|
3000
|
212
|
2017
|
4000
|
213
|
2018
|
1050
|
214
|
2018
|
1100
|
215
|
2018
|
1150
|
tJavaFlex: This enables you to enter personalized code in order to integrate it in Talend program. With tJavaFlex, you can enter the three java-code parts (start, main and end) that constitute a kind of component dedicated to do a desired operation.
It lets you add Java code to the Start/Main/End code sections of this component itself. You can use this component as a start, intermediate or output component.
SalesPersonId
|
SalesYear
|
TotalSales
|
RunSal
|
201
|
2015
|
100
|
100
|
202
|
2015
|
200
|
300
|
203
|
2015
|
300
|
600
|
204
|
2015
|
400
|
1000
|
205
|
2016
|
50
|
1050
|
206
|
2016
|
100
|
1150
|
207
|
2016
|
150
|
1300
|
208
|
2016
|
200
|
1500
|
209
|
2017
|
1000
|
2500
|
210
|
2017
|
2000
|
4500
|
211
|
2017
|
3000
|
7500
|
212
|
2017
|
4000
|
11500
|
213
|
2018
|
1050
|
12550
|
214
|
2018
|
1100
|
13650
|
215
|
2018
|
1150
|
14800
|
You can as well use it as a one-component sub-job but you must know the Java language.
To watch a live demo -
To learn more, please follow us -
To Learn more, please visit our YouTube channel at -
To Learn more, please visit our Instagram account at -
To Learn more, please visit our twitter account at -
No comments:
Post a Comment