max and max2 functions
The max and max2 functions are intended to retrieve the maximum value of an attribute.
The max function retrieves the maximum value of an attribute, while
The max2 function compares two attributes and retrieves the maximum value between them. (we suggest you not to use this function, it only allows compatibility with processes coming from previous Rulex versions (4 and backwards)
The maximum (max) function only is available also by:
Selecting the column and finding the maximum in the Info panel (for continuous values only).
Dragging the attribute in the Apply area of the /wiki/spaces/RPDP/pages/2658467940
Function and parameters
max(column, group)
max2(column1, column2)
Be careful when using these functions, because the parameters written into brackets look the same, as they are two attributes, but it is mandatory to add the 2 to the function if we want to compare two values.
max function parameters
Parameter | Description |
---|---|
column | It identifies the column to which you want to apply the formula. Multiple attributes can be specified, as long as they are enclosed in double brackets. The column parameter is mandatory. |
group | It allows you to group the results by a certain column. |
max2 function parameters
Parameter | Description |
---|---|
column1 | It identifies the column to which you want to apply the formula. The column1 parameter is mandatory. |
column2 | It identifies the column to which you want to apply the formula. The column2 parameter is mandatory. |
Example - max
The following example uses the Students Performance dataset.
Description | Screenshot |
---|---|
| |
| |
When the column value is a list enclosed in double brackets, the formula considers the single rows of the attributes, so it calculates the maximum considering the chosen attributes in rows. The formula will be: The results can be read as follows:
|
Example - max2
The following example uses the Students Performance dataset.
Description | Screenshot |
---|---|
and so on. The same operation can be performed with the max function. The max2 function allows compatibility with processes coming from previous Rulex versions. |