Reputation: 97
I have 2 columns - Matches(Integer), Accounts_type(String). And i want to create a third column where i want to get proportions of matches played by different account types. I am new to Talend & am facing issue with this for past 2 days & did a lot of research but to no avail. Please help..
Upvotes: 1
Views: 1789
Reputation: 4061
You need to read your source data twice (I used tFixedFlowInput_1
and tFixedFlowInput_2
with the same data). The idea is to calculate the total of your matches in tAggregateRow_1
, it simply does a sum of all Matches without a group by column, then use that as a lookup.
The tMap then joins your source data with the calculated total. Since the total will always be one record, you don't need any join column. You then simply divide Matches by Total as required.
This is supposing you have unique values in Account_type; if you don't, you need to add another tAggregateRow between your source and tMap_1
, in order to get sum of Matches for each Account_type (group by Account_type).
Upvotes: 1