math.percentRank( arg as (String | Number | Boolean | null | Array | Object)[], value as xs.anyAtomicType, [options as String[]] ) as Number?
Returns the rank of a value in a data set as a percentage of the data set.
If the given value is not equal to any item in the sequence, the function
returns the empty sequence. See math:rank
.
math.percentRank([1, 7, 5, 5, 10, 9],9) => 0.833333333333333
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.