MODE

Returns a value which repeats itself most number of times among all the values displayed in the rows of the table control. For example, if there are 5 rows containing values for UnitPrice as 57, 57, 57, 19, and 98, then the mode is 57 which repeats itself the maximum number of times. The function accepts values only from textbox, label and literal controls. This function is called as <TableControlName>.MODE("<ControlName>"). Use a TableControl instance to indicate which TableControl contains the values to be operated on by the function (e.g., Order_DetailsTableControl, ProductsTableControl, CategoriesTableControl).

Syntax

= <TableControlName>.MODE(controlName)

Parameters

controlName

It represents the name of the control which contains the values whose mode is to be calculated. The controlName should be a string (e.g., “UnitPrice”, “Quantity”, “Discount”). The values in the control can be an integer (e.g., 37), a decimal value (e.g., 37.48), or a string.

Return Type

Decimal

Examples

Example

Returns

= ProductsTableControl.MODE(“UnitsInStock”)

The mode of the values displayed in the rows of the “UnitsInStock” control.

= Order_DetailsTableControl.MODE("Quantity")

The mode of the values displayed in the rows of the “Quantity” control.

= Order_DetailsTableControl.MODE("Discount")

The mode of the values displayed in the rows of the “Discount” control.