Reputation: 65
Is it possible to get values from a Excel file and use them to filter rows in Talend? For example: I have an Excel file with account numbers list. In Talend, I have a query in a tDBInput linked to a tMap, that is linked to a tFilter. This filter is based on Excel columns values with the accounts list. Or if I can use the account list in the where clause in tDBInput. The problem is that the account list can change anytime. Thanks a lot.
Upvotes: 0
Views: 995
Reputation: 2552
There are multiple ways to proceed :
Link your tDBInput to tMap as the main flow, and your excelInput as the lookup. Make the join between the two flow in tMap as an inner join : this way you can filter main data with data coming from excel. The inconvenient is that you will read all data from DBInput and filter after that, which is less efficient.
You can also make it through two subjobs :
First subjob : tFileInputExcel -> tJavaRow . Push your list of accounts to a String in a context variable to construct your "where" query. (you can also use a tAggregateRow with 'list' mode to build a list )
Second subjob : use this constructed context variable as filter in your DBInput query. This way you'll read only valuable data in this component.
Upvotes: 1