Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my data set I have Years like 2018,2017,2016, etc. I dont want to limit the script for 2018, but on the list box I would like to see only Current and 3 Prev years, how can I do that ?
One best solution this for expression in list box rather direct field
If(Year <> 2018, Year)
=aggr(if(YearField>= year(addyears(today().-3)) and YearField<= year(today()), YearField),YearField)
Create below variables:
vNow: Date(max(TOTAL DateYearField))
vPrev3: $(vNow)-AddYears($(vNow),-3)
Then in list box use below condition. in drop down select expression at the bottom most.
=if(($(vNow) - DateYearField))>0) and ($(vNow) - DateYearField))<= $(vPrev3)),DateYearField)
Maybe
=IF(Year >= Year(Now())-3 and Year <= Year(Now()),Year)
Syntax does not look right
Or try this
AGGR(If(YEAR>= year(today()) - 3 and YEAR <=year( today()), YEAR), YEAR)
Simple way to do this is using calculated expression in listbox:
=Valuelist(Year(Today()),Year(Today())-1,Year(Today())-2,Year(Today())-3)