ContributionsMost RecentMost LikesSolutionsRe: Sum in a loop @pmancevski $group.map((value, index) => value.extend({‘sum’ : parseInt(value.sum) + ((index + 1) * 10)})) - This expression solved my query. Thank you! Re: Sum in a loop @pmancevski How to apply the same logic on group by values. Sample data is attached below. Sum should be incremented by 10 for each row. [ { “groupBy”: { “number”: “1115122” }, “group”: [ { “name”: “TD”, “number”: “1115122”, “sum”: “390” }, { “name”: “TD”, “number”: “1115122”, “sum”: “390” } ] }, { “groupBy”: { “number”: “1115982” }, “group”: [ { “name”: “TD”, “number”: “1115982”, “sum”: “390” } ] }, { “groupBy”: { “number”: “1115962” }, “group”: [ { “name”: “TD”, “number”: “1115962”, “sum”: “390” } ] } ] required output: 1st group : sum=400, 410 2nd group : sum=400 3rd group : sum=400 Re: Sum in a loop @pmancevski Thank you for the quick response. It helped. Sum in a loop Hi, I have an default value for field $sum=390 and 10 input records(count may increase/decrease). Requirement :Each row should get $sum=$sum+10. if 1st row having sum=400, 2nd sum=410… Please suggest. SolvedRe: Is it possible to perform group by and sum operation in Mapper/Conditional snap? @bojanvelevski I was trying with this approach, but getting below error. expression using : $.reduce((acc,curr)=> acc + curr.INSTALLCUQTY,0) Also, getting ‘null’ as output for sum. Re: How to get the cartesian product kind of output? @Spiro_Taleski The given solution helped me. Thanks a lot!. How to get the cartesian product kind of output? I have an Join(merge) output as below. [ { “BCUNAME”: “1q”, “REQUESTNUM”: “639431”, “no”: “4”, }, { “BCUNAME”: “e4” }, { “BCUNAME”: “rf” }, { “BCUNAME”: “14r” }, { “BCUNAME”: “26t” }, { “BCUNAME”: “3PH” } ] But I want to keep “REQUESTNUM”: “639431”, “no”: “4” in every row like below. [ { “BCUNAME”: “1q”, “REQUESTNUM”: “639431”, “no”: “4”, }, { “BCUNAME”: “e4”, “REQUESTNUM”: “639431”, “no”: “4”, }, { “BCUNAME”: “rf” “REQUESTNUM”: “639431”, “no”: “4”, }, { “BCUNAME”: “14r” “REQUESTNUM”: “639431”, “no”: “4”, }, { “BCUNAME”: “26t” “REQUESTNUM”: “639431”, “no”: “4”, }, { “BCUNAME”: “3PH” “REQUESTNUM”: “639431”, “no”: “4”, } ] Please suggest SolvedRe: Is it possible to perform group by and sum operation in Mapper/Conditional snap? Hi @bojanvelevski , Thanks you. I tried with group by N(It does batching randomly), but I want to group them based on 3 fields say $A,$B,$C and then I want to do SUM on other field $D.Is there any such functionalities available in snaplogic using mapper? Is it possible to perform group by and sum operation in Mapper/Conditional snap? Is it possible to perform sum of the values by grouping them on few fields in mapper/conditional snap in snaplogic. Because with aggregate snap I’m losing all input fields and keeping copy snap is taking more time to execute. Re: How to map multiple target path to single field name @koryknick It helped, Thanks. I used json splitter after this and then mapped it to single target path.