# First - chart function

First() returns the value of an expression evaluated with a pivot table's dimension values as they appear in the first column of the current row segment in the pivot table. This function returns NULL in all chart types except pivot tables.

Syntax:

first([ total ] expression [ , offset [,n ]])

Arguments:

Argument Description
expression The expression or field containing the data to be measured.
offset

Specifying an offsetn, greater than 1 moves the evaluation of the expression n rows further to the right from the current row.

Specifying an offset of 0 will evaluate the expression on the current row.

Specifying a negative offset number makes the First function work like the Last function with the corresponding positive offset number.

n

By specifying a third parameter n greater than 1, the function will return a range of n values, one for each of n table rows counting to the right from the original cell.

TOTAL

If the table is one-dimensional or if the qualifier TOTAL is used as argument, the current column segment is always equal to the entire column.

If the pivot table has multiple horizontal dimensions, the current row segment will include only columns with the same values as the current column in all dimension rows except for the row showing the last horizontal dimension of the inter-field sort order.The inter-field sort order for horizontal dimensions in pivot tables is defined simply by the order of the dimensions from top to bottom.

Examples:

first( sum( Sales ))

first( sum( Sales ), 2 )

first( total sum( Sales )

```rangeavg (first(sum(x),1,5))``` returns an average of the results of the sum(x) function evaluated on the five leftmost columns of the current row segment.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?