Question 27: Explain Rangesum, Rangeave, and Rangecount Functions. Answer: Rangesum (Expr1 (, Expr2, ... Exprn) )
Question 27: Explain Rangesum, Rangeave, and Rangecount Functions. Answer: Rangesum (Expr1 (, Expr2, ... Exprn) )
exprN ]) Returns the sum of a range of 1 to N arguments. As opposed to the + operator, rangesum will treat all nonnumeric values as 0. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangesum (1,2,4) rangesum (1,'xyz') rangesum (null( )) rangesum (above(count(x),-1,3)) returns 7 returns 1 returns 0 returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.
rangeavg(expr1 [ , expr2, ... exprN ]) Returns the average of a range of 1 to N arguments. If no numeric value is found, NULL is returned. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangeavg (1,2,4) rangeavg (1,'xyz') rangeavg (null( ), 'abc') rangeavg (above(count(x),0,3)) returns 2.33333333 returns 1 returns NULL returns a sliding average of the result of the inner count(x) expression calculated on the current row and two rows above the current row.
rangecount(expr1 [ , expr2, ... exprN ] ) Returns the number of values found within a range of 1 to N arguments. NULL values are not counted. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples:
returns 3 returns 2 returns 0 returns the number of values within the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
Question 28: Explain rangemin() and rangemax() functions. Answer: rangemin (expr1 [ , expr2, ... exprN ]) Returns the lowest numeric value found within a range 1 to N arguments. If no numeric value is found, NULL is returned. Examples: rangemin (1,2,4) rangemin (1,'xyz') returns 1 returns 1
rangemin (null( ), 'abc') returns NULL rangemin (above(sum(x),-1,3)) returns the lowest of the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
rangemax(expr1 [ , expr2, ... exprN ]) Returns the highest numeric values found within a range of 1 to N arguments. If no numeric value is found, NULL is returned. Examples: rangemax (1,2,4) rangemax (1,'xyz') returns 4 returns 1
rangemax (null( ), 'abc') returns NULL rangemax (above(sum(x),-1,3)) returns the highest of the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
Question 29: Explain rangenumericcount (), rangenullcount(), rangetextcount(), rangemissingcount(), Answer: rangenumericcount(expr1 [ , expr2, ... exprN ]) Returns the number of numeric values found within a range of 1 to N arguments. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangenumericcount (1,2,4) returns 3 rangenumericcount (2,'xyz') returns 1
rangenumericcount (null( )) returns 0 rangenumericcount (above(sum(x),-1,3)) returns the number of numeric values within the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
rangetextcount(expr1 [ , expr2, ... exprN ]) Returns the number of text values found within a range of 1 to N arguments. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangetextcount (1,2,4) returns 0 rangetextcount (2,'xyz') returns 1 rangetextcount (null( )) returns 0 rangetextcount (above(sum(x),-1,3)) returns the number of text values within the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
Returns the number of NULL values found within a range of 1 to N arguments. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangenullcount (1,2,4) returns 0 rangenullcount (2,'xyz') returns 0 rangenullcount (null( ),null( )) rangenullcount (above(sum(x),-1,3)) returns 2 returns the number of NULL values within the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
rangemissingcount(expr1 [ , expr2, ... exprN ]) Returns the number of non-numeric values (including NULL values) found among 1 to N arguments. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangemissingcount (1,2,4) returns 0 rangemissingcount (2,'xyz') returns 1
rangemissingcount (null( )) returns 1 rangemissingcount (above(sum(x),-1,3)) returns the number of non-numeric values within the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
Question 30: Explain rangeminstring(), rangemaxstring() Answer: rangeminstring(expr1 [ , expr2, ... exprN ]) Returns the first value in text sort order found among 1 to N arguments.
The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples:
rangeminstring (1,2,4) rangeminstring ('xyz','abc') rangeminstring (null( )) rangeminstring (above(sum(x),-1,3)) returns 1 returns 'abc' returns NULL returns the first (in text sort order) of the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
rangemaxstring(expr1 [ , expr2, ... exprN ]) Returns the last value in text sort order found among 1 to N arguments. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples:
rangemaxstring (1,2,4) rangemaxstring ('xyz','abc') rangemaxstring (null( )) rangemaxstring (above(sum(x),-1,3)) returns 4 returns 'xyz' returns NULL returns the last (in text sort order) of the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
Question 31: Explain rangemode() and rangeonly() function(). Answer: rangemode(expr1 [ , expr2, ... exprN ]) Returns the mode value, i.e. the most commonly occurring value within a range of 1 to N arguments. If more than one value shares the highest frequency, NULL is returned. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values.
Examples: rangemode (1,2,9,2,4) returns 2 rangemode ('a',4,'a',4) returns NULL rangemode (null( )) returns NULL
returns the most commonly occurring value within the three results of the sum(x) rangemode function evaluated on the row below the current row, the current row and the (above(sum(x),-1,3)) row above the current row.
rangeonly(expr1 [ , expr2, ... exprN ]) If exactly one non-NULL value exists among the range of N expressions, that value will be returned. In all other cases, NULL is returned. The argument expressions of this function may contain Chart Inter Record Functions with a third optional parameter, which in themselves return a range of values. Examples: rangeonly (1,2,4) rangeonly (1,'xyz') rangeonly (null( ), 'abc') returns NULL returns NULL returns 'abc'
uses the three results of the sum(x) function evaluated on the row below the rangeonly current row, the current row and the row above the current row. If they contain (above(sum(x),-1,3)) exactly one value, that value will be returned.