I want to return the maximum value in a column in a block with values for 13 periods.
Max([CountVariable])
returns the value against each period.
Max([CountVariable] forAll([Period))
returns the sum of all values.
This is what I am getting:
Period CountVariable Max([CountVariable]) Max([CountVariable] forAll([Period))
1 10 10 45
2 15 15 45
3 20 20 45
This is what I'd like:
Period CountVariable Max
1 10 20
2 15 20
3 20 20
You're close. To get the maximum for all periods, you need to set the variable to evaluate in the output context. You do this by specifying the context operator (ForAll) outside of the Max() function. So:
Max([CountVariable]) forAll([Period])