These examples use *Ad Hoc Expressions* within a Set Analysis Expressions (marked red).

1

Sum of Sales based on the current selection, but calculate only Sales in the last/current year.

`Sum({$<Year={$(=max(Year))}>}Sales)`

2

Return Sum of Sales only for the year before the maximum year.

`Sum({$<Year={$(=Max(Year)-1)}>}Sales)`

© qlikblog.at / Stefan Walther 2017 ~ "Set Analysis Wizard for QlikView" Version 0.5