Forum Discussion
bojanvelevski
2 years agoValued Contributor
Hey Vikas2022,
The flow in your pipeline is still object oriented, so you cannot concatenate the arrays at the end. You need some kind of aggregator snap, which in my case I used the GroupBy N snap. Combinated with the reduce function , I believe you'll get the desired output. Check the pipeline and let me know what you think.
Hello bojanvelevski thanks for the pipeline. However, one scenario is still not covered in the output.
Which is, If for any particular accountId there are more than 2 accountnames then in the final json output I want only accountname,maxvus,doccount for the record whose maxvus is bigger than the other.
So in given JSON Generator SNAP you can see it is printing only first accountname by default (Vis Card Services and its maxvus and doccount) but if you change maxvus value to lets say 100 in JSON Generator SNAP for accountname (Vitoria Card Services SA) then ideally it should print Vitoria but instead it still prints Vis Card.