op.max( aggColName as String, columndef as String, [options as String] ) as aggregatedef
This function gets the largest non-null value of the column for the rows in the group or row set. The result is used for building the parameters used by the prototype.groupBy function.
const op = require('/MarkLogic/optic'); op.fromView('main', 'expenses') .groupBy('Category', op.max("Maximum Spent", "Amount")) .orderBy('Category') .result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.