Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

End of the year from Year

Goodmorning everyone .


I have the following problem.

I have to get a year, the date of the end of the year (31/12 / year)

Example

VarAnnoPrec = 2015

You should get as data for use = 31/12/2015

Thank you all.


1 Solution

Accepted Solutions
rubenmarin

Hi Manuel, you can use MakeDate to create the date:

- MakeDate($(VarAnnoPrec), 12, 31)

To create a timestap referencing the last second of the year (for use in comparison with timestamp dates) you can use YearEnd:

- YearEnd(MakeDate($(VarAnnoPrec), 12, 31))

The first one returns 00:00:00 as time, the 2nd returns 23:59:59

View solution in original post

3 Replies
rubenmarin

Hi Manuel, you can use MakeDate to create the date:

- MakeDate($(VarAnnoPrec), 12, 31)

To create a timestap referencing the last second of the year (for use in comparison with timestamp dates) you can use YearEnd:

- YearEnd(MakeDate($(VarAnnoPrec), 12, 31))

The first one returns 00:00:00 as time, the 2nd returns 23:59:59

Anonymous
Not applicable
Author

Have you tried the YearEnd function?

i.e. Past in a textbox to test

=YearEnd('01/01/'&2018)

=YearEnd('01/01/'& VarAnnoPrec) )

Anonymous
Not applicable
Author

Thank you so much !!!! works perfectly

Manuel