21.01.2013 Views

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples:<br />

sign(x)<br />

odd( 3 ) returns true<br />

odd( 2 * 10 ) returns false<br />

odd( 3.14 ) returns NULL<br />

Returns 1, 0 or -1 depending on whether x is a number, 0 or a negative number. If no numeric value is found,<br />

NULL is returned.<br />

Examples:<br />

sign( 66 ) returns 1<br />

sign( 0 ) returns 0<br />

sign( - 234 ) returns -1<br />

bitcount(i )<br />

Returns the number of set bits in i. Where i is interpreted as a signed 32-bit integer.<br />

Examples:<br />

bitcount ( 3 ) returns 2<br />

bitcount ( -1 ) returns 32<br />

bitcount ( n )+bitcount ( bitnot n ) returns 32 (as long as n is a valid integer)<br />

Chart Range Functions<br />

Range functions will replace the following Chart General Numeric Functions (page 805): numsum,<br />

numavg, numcount, nummin and nummax, which should now be regarded as obsolete.<br />

rangesum(expr1 [ , expr2, ... exprN ])<br />

Returns the sum of a range of 1 to N arguments. As opposed to the + operator, rangesum will treat all nonnumeric<br />

values as 0.<br />

The argument expressions of this function may contain Chart Inter Record Functions (page 815) with a<br />

third optional parameter, which in themselves return a range of values.<br />

Examples:<br />

rangesum (1,2,4) returns 7<br />

rangesum (1,'xyz') returns 1<br />

rangesum (null( )) returns 0<br />

rangesum<br />

(above(count(x),-1,3))<br />

returns the sum of the three results of the count(x) function evaluated on the<br />

row below the current row, the current row and the row above the current row.<br />

rangeavg(expr1 [ , expr2, ... exprN ])<br />

Returns the average of a range of 1 to N arguments. If no numeric value is found, NULL is returned.<br />

The argument expressions of this function may contain Chart Inter Record Functions (page 815) with a<br />

third optional parameter, which in themselves return a range of values.<br />

Examples:<br />

809

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!