I want to compute the max of a column over an entire object set, without grouping by a property.
Hey @arochat ,
You could do: Objects.search().employee().max(e => e.tenure);
You can find more examples at the bottom of this page - https://www.palantir.com/docs/foundry/functions/api-object-sets/#computing-aggregations
1 Like
We use reduce() in TypeScript and I added an example with computecolumn as the specific column, hope it works for you. (NEGATIVE_INFINITY is the initial value to ensure that any number in your column will be larger.)
const maxValue = obj.reduce((max, currentObj) => {
return currentObj.computecolumn > max ? currentObj.computecolumn : max;
}, Number.NEGATIVE_INFINITY);