โ02-04-2019 12:37 AM
How to increment the counter (variable) based on the incoming data in snaplogic.
CostCenter, TestCompany
Test_Cost_Center_001,Test_company_1
Test_Cost_Center_001,Test_company_2
Test_Cost_Center_002,Test_company_1
Test_Cost_Center_002,Test_company_2
Test_Cost_Center_002,Test_company_3
Test_Cost_Center_002,Test_company_4
CostCenter, TestCompany, ID
Test_Cost_Center_001,Test_company_1, 1
Test_Cost_Center_001,Test_company_2, 2
Test_Cost_Center_002,Test_company_1, 1
Test_Cost_Center_002,Test_company_2, 2
Test_Cost_Center_002,Test_company_3, 3
Test_Cost_Center_002,Test_company_4, 4
Experts over here, please help in achieving the above solution using the right snap.
โ02-06-2019 03:28 AM
Thank you So much sarathmattam,
Iโm able to achieve this using mapper in the following way.
Read the data in sorted order
Generate the sequence
Copy the data into two outputs
For one o/p, Use Aggregate to find the min sequence grouping on the cost_center
From other o/p join the data using the cost_center
Use Mapper, and in one of the port define the logic as : (Value - min_Seq)+1
Here Value is the sequence generated from the sequence snap
Min_Seq is the minimum sequence value of the respective group obtained from aggregate snap.
โ02-06-2019 08:27 AM
Thanks for sharing your solution ๐