[]
        
(Showing Draft Content)

LASTVALUE

This function returns the value of the argument from the last row of the window frame. It does not require ORDERBY.

Syntax

LASTVALUE(value_function)

Arguments

The function provides the following argument.

Argument

Description

value_function

[required] The field name or formula.

Example

// WINDOW(LASTVALUE([@sold]), PARTITIONBY([city]),ORDERBY([month]), FRAMERANGE(-1,-1))

city  |  month | sold  |  last_value
----------------------------------------------
Paris      1      500       400
Paris      2      300       400
Paris      3      400       400
Rome       2      200       500
Rome       3      300       500
Rome       4      500       500