Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I need to save in a variable the value of the latest selection (year) for the computation of a sum on a previous year.
Anybody knows how to do this?
Thanks
Marco
You could use max() for this directly within the expression:
sum({< year = {"$(=max(year))"}>} value)
vs.
sum({< year = {"$(=max(year)-1)"}>} value)
- Marcus
you could do what Marcus suggested and not use variable at all. but if you want to create variables for other purposes, then create variables using Ctrl+Alt+V and click on Add.
1. vMaxYear and expression will be =max(year)
2. vPrevYear and expression as = max(year) -1