Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
There is a flat file with CustomerID, OrderDate, SalesAmount.
Each customer can have multiple orders. The report will get the recent 5 orders for each customer.
It is easy to do in SQL, but the source is a flat file and the data will not be loaded to SQL database.
Is there any way in Talend to apply this scenario? Thank you very much for your help.
(if a new column RowNumber is added to the data flow and the value is set to 1,2,3,4,5,...for each customer, then a tFilterRow can get the records with RowNumber<=5
how to write java code in the tjavaflex?)
CustomerID | Order Date | SalesAmount |
1 | 8/23/2017 | 6.6 |
1 | 8/11/2017 | 6.6 |
1 | 8/7/2017 | 6.6 |
1 | 7/29/2017 | 6.6 |
1 | 7/23/2017 | 6.6 |
1 | 7/16/2017 | 6.6 |
1 | 7/3/2017 | 6.6 |
1 | 8/23/2017 | 6.6 |
1 | 7/23/2017 | 6.6 |
2 | 6/23/2017 | 6.6 |
2 | 4/23/2017 | 6.6 |
2 | 1/23/2017 | 6.6 |
Hi,
Yes with tJavaFlex it's look like fine . Your code can be like :
TFileInput ---row11--- tJavaFlex --- row12 --- tlogrow
Don't Forget to add a column to your tJavaFlex output schema.
This will be work but you have maybe some special code to limit case like first and last line
Good luck
SGV
Hi,
Yes with tJavaFlex it's look like fine . Your code can be like :
TFileInput ---row11--- tJavaFlex --- row12 --- tlogrow
Don't Forget to add a column to your tJavaFlex output schema.
This will be work but you have maybe some special code to limit case like first and last line
Good luck
SGV
SGV: thank you for your reply. Your solution works like magic.