Table calculation functions (WIP) Flashcards
LOOKUP(expression, [offset])
Primary function
Returns the value of the expression in a target row,
specified as a relative offset from the current row.
If the offset is -1, then the result will be returned for
the previous value in the scope and direction
LOOKUP(SUM([Profit]), FIRST ()+2) computes the
SUM([Profit]) in the third row of the partition.
TOTAL(expression)
Primary function
Returns the total for the given expression in the
current partition
TOTAL(SUM([Sales])) returns the total for the sum
of sales based on the current scope and direction.
PREVIOUS_VALUE
Primary function
which returns the value of the expression in the previous row
RUNNING_SUM, RUNNING_AVG and other similar running calculations
Primary functions
return the running sum, running average, etc. of the given expression, from the first row in the partition to the current row.
WINDOW_AVG, WINDOW_STDEV, and other similar window calculations
Primary functions
return the average, standard deviation, etc. of the expression within the window (defined by means of offsets from the current row).
RANK
Primary function
returns the standard competition rank for the current row in the partition with other options available that vary on how they process identical values.
FIRST and LAST
Helper functions
return the number of rows from the current row to the first or last row in the partition.
INDEX
Helper function
returns the position of the current value, given the chosen scope and direction.
SIZE
Helper function
returns the number of rows in the current scope.