Window versus running functions
We have briefly discussed the WINDOW
functions already. There's also another type of function, called the RUNNING
function. The WINDOW
functions have specific partitions, that is, they measure either the whole table, pane, or cell, or from a specific number of previous or future values. Alternatively, the RUNNING
function compares all the values before the current value in the partition.
In the following example, we graphed the average percentage of the GDP that was from high-tech exports by region and by year in the World Development Indicators data source. This is a simple spark bar graph. We have hidden the header for the y axis in this graph.
We created a calculated field that, for each year, tests whether the average High Tech Exports as a percentage of the GDP is equal to the running maximum, that is, is the value for any year higher than all the years before it. The results are true and false, as shown in the following screenshot:
The RUNNING_MAX
function...