Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Function Index > R

RANKEQ

Scroll Prev Top Next More

(RANKEQ(arg,column,table/view,order))

 

Returns the statistical rank of a given value, within a supplied array of values. If there are duplicate values in the list, these are given the same rank.

 

arg - specifies the item to rank. The value must be TEXT. The CTXT may be used, if needed.

column - specifies the column to compare arg to. The value must be TEXT.

table/view - specifies the table/view which contains the column The value must be TEXT.

order - 0 for ranking from highest to lowest (like for scores)

        - 1 for ranking from lowest to highest (like for race times)

 

The resulting variable value is the INTEGER data type.

 

After the RANKEQ function is used, the ProcRANKEQ stored procedure will be loaded into the database, if the procedure does not already exist.

 

The below calculates the rank of 80,000 as 23 in a list of car sales.

 

SET VAR vRankEQ DOUBLE = (RANKEQ('80,000','InvoicePrice','CarSales',1))

SHOW VAR vRankEQ

        23.