Forum Discussion
2 Replies
- bojanvelevskiValued Contributor
Hey @vaidyarm,
Use the following expression in a mapper to get the expected result:
$array.map((x,index)=>{"value":x,"index":index}).filter(x=>x.value==($array.sort((a,b)=>b-a)[0]))
This will produce an array of objects, which will contain the max value, and It’s corresponding index.
Input:
Output:
- vaidyarmContributor
Hey, did the similar, but keeping the filter in one mapper and sort as snap.
Thanks for input!!