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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

min( expression[, rank] )<br />

Returns the minimum numeric value of expression encountered over a number of records as defined by a<br />

group by clause. Rank defaults to 1 which corresponds to the lowest value. By specifying rank as 2 the second<br />

lowest value will be returned. If rank is 3 the third lowest value will be returned and so on.<br />

Examples:<br />

Load Month, min(Sales) as SmallestSalePerMonth from abc.csv group by<br />

Month;<br />

Load Month, min(Sales, 2) as SecondSmallestSalePerMonth from abc.csv<br />

group by Month;<br />

max( expression[, rank] )<br />

Returns the maximum numeric value of expression encountered over a number of records as defined by a<br />

group by clause. Rank defaults to 1 which corresponds to the highest value. By specifying rank as 2 the second<br />

highest value will be returned. If rank is 3 the third highest value will be returned and so on.<br />

Examples:<br />

Load Month, max(Sales) as LargestSalePerMonth from abc.csv group by<br />

Month;<br />

Load Month, max(Sales, 2) as SecondLargestSalePerMonth from abc.csv<br />

group by Month;<br />

only(expression )<br />

If expression over a number of records, as defined by a group by clause, contains only one numeric value,<br />

that value is returned. Else, NULL is returned.<br />

Example:<br />

Load Month, only(Price) as OnlyPriceSoldFor from abc.csv group by<br />

Month;<br />

mode(expression )<br />

Returns the mode value, i.e. the most commonly occurring value, of expression over a number of records, as<br />

defined by a group by clause. If more than one value is equally commonly occurring, NULL is returned.<br />

Mode can return numeric values as well as text values.<br />

Examples:<br />

Load Month, mode( ErrorNumber ) as MostCommonErrorNumber from abc.csv<br />

group by Month;<br />

Load Month, mode( Product ) as ProductMostOftenSold from abc.csv group<br />

by Month;<br />

firstsortedvalue ([ distinct ] expression [, sort-weight [, n ]])<br />

Returns the first value of expression sorted by corresponding sort-weight when expression is iterated over a<br />

number of records as defined by a group by clause. Sort-weight should return a numeric value where the lowest<br />

value will render the corresponding value of expression to be sorted first. By preceding the sort-value<br />

expression with a minus sign, the function will return the last value instead. If more than one value of expression<br />

share the same lowest sort-order, the function will return NULL. By stating an n larger than 1, the nth<br />

value in order will be returned. If the word distinct occurs before the expression, all duplicates will be disregarded.<br />

Example:<br />

Load Customer,<br />

287

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

Saved successfully!

Ooh no, something went wrong!