logo SmartSurvey / Scripting Docs
Back to Docs
Built-in Function
maxvalueindexof[Qx] Value

Returns the 1-based row index of the entry with the highest value in a grid or multi-entry question. Use to identify which item received the highest rating.

Parameters
Parameter Type Description
Qx Question ref *GRIDSR or list-numeric question
Returns: Integer — 1-based index of the highest-valued entry
Examples
expressions
maxvalueindexof[Q32]=1   -- Berger (row 1) is the top-rated brand
maxvalueindexof[Q32]!=2  -- Asian Paints is not the highest rated
maxvalueindexof[Q7]=3    -- row 3 has the highest satisfaction score
If multiple rows share the maximum value, the first (lowest index) is returned.
Related