How to use SQL Lag Function concept in talend

Seven Stars RAJ
Seven Stars

How to use SQL Lag Function concept in talend

Hi Talend Folks,

 

Thanks
RAJ

Accepted Solutions
Eight Stars

Re: How to use SQL Lag Function concept in talend

Hi there,

 

This sort of thing can be done very easily in a tJavaFlex component, as follows.

 

LagFunctionJob.png

 

The tFixedFlowInput generates rows with a single Integer column:

 

tFixedFlowInput3.png

 

Add a new column to the output schema of th tJavaFlex component for the LAG value:

 

tJavaFlexSchema3.png

 

And the the following code will output the previous (LAG) value, before setting it to the current value of newColumn, which will be available when the next row is processed:

 

tJavaFlexCode.png

 

Regards,

 

 

Chris 


All Replies
Eight Stars

Re: How to use SQL Lag Function concept in talend

Hi there,

 

This sort of thing can be done very easily in a tJavaFlex component, as follows.

 

LagFunctionJob.png

 

The tFixedFlowInput generates rows with a single Integer column:

 

tFixedFlowInput3.png

 

Add a new column to the output schema of th tJavaFlex component for the LAG value:

 

tJavaFlexSchema3.png

 

And the the following code will output the previous (LAG) value, before setting it to the current value of newColumn, which will be available when the next row is processed:

 

tJavaFlexCode.png

 

Regards,

 

 

Chris 

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.