Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
richards
Contributor III
Contributor III

Let year(today) problem showing todays result as today

In my application i´m loading the year  2019, 2020, 2021 from the database.

In my application i would like to use my own named variabel CurrentYear, so that i could divide the values between this year and last years. etc....

However in the database there are more than three years so i´m using the following statement in the script.

Let vMinYear = Year(Today))+1;

Let vMaxYear = Year(Today))-1;

On the database i´m then determing the year as i = $(vMaxYear) To $(vMinYear) so it´s only loading three years.

However when making a +1 statement the 2021 is determined as a currentYear. 

So the questions is how to dermine so that the current year is 2020 and to make it possible to choose other years 

The currentYear should always be today.

 

4 Replies
Lisa_P
Employee
Employee

It appears you have your Min and Max reversed.

richards
Contributor III
Contributor III
Author

Yes of course. However this doesn´t explain why the currentYear Value that is shown is 2021. I´m woundering if this could be changed so the data that is shown is today.

The max and min is only used to load number of years.

tresesco
MVP
MVP

@richards 

I guess I didn't get it right. What do you get for year(today()) ?

richards
Contributor III
Contributor III
Author

on the variable list in the arc i have current year as defined as =Max(Year)

The varables vMaxYear is 2021 now after i rearanged the min and max.  i.e. now vMinYear 2020.

Year today is 2020.