IndexOfMax (PQL)

Returns the index of the maximum value in a list of numbers.

  • Returned Output: Numeric
  • Library: PQL \ Common \ Statistical
  • Version: 2020.18.000
  • Compatibility:
    • Can be combined with and other PQL function throughout the application.
    • It CANNOT be used with MDX or VBA functions. But it can be used on MDX-based content in other parts of the application.

Syntax

IndexOfMax( <Numeric List> )

or

IndexOfMax( <Numeric N> )

* Click on the function's arguments above for more details on the input values.

Comments
  • The list of numbers can be typed in as a comma delimited list or inserted via an array.
  • The index is zero based. So the first position is "0". The last position is the number of items less 1 ("n-1")
  • If the method is used in other parts of the application, the input parameters can be changed
    • In Formulate, the inputs can be Data points, other functions or members
    • In the dynamic querying tools (like triggers, infographics and dynamic text), the inputs can be static values or other methods
  • Use this function with other functions to dynamically find items in a resolve grid of data.
Different Function types

Example

This example simply finds the index of the maximum value across the 4 values 3 to 6. The result is "2" for the third position.

IndexOfMax(3,4,6,5)