Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last day of previous year

Hello

I wonder how can i get the last day of previous year

7 Replies
Anonymous
Not applicable
Author

YearEnd(today(),-1)

Anonymous
Not applicable
Author

Ioannis

Do beware though that YearEnd(today(),-1) will return a timestamp with the time after the date of 23:59:59

If you just want the pure date then floor & date it.

     =date(floor((yearend(Today(), -1))))

Best Regards,     Bill

Not applicable
Author

ok ,

and if i have to make an expression with this → Sum(INIT_QTY) how i do it all together ?

Im sorry but im very new in all this

Thanks in advance

Anonymous
Not applicable
Author

Ioannis

I am not sure what you mean by that addition to your original question, could you clarify.

Best Regards,     Bill

Not applicable
Author

Im sorry Bill

I mean that i have to make an expression like following :

Sum(INIT_QTY) .

But i must  get the Sum of the last day of previous year

preminqlik
Specialist II
Specialist II

hi try this

sum({<Year={'$(=Max(Year)-1)'},Month={'$(=Maxstring(Month))'},Date={'$(=max(Date))'}>}INIT_QTY)

or

sum({<Date={'$(=makedate('$(=max(Year)-1)','$(=max(Monthnum))',''$(=max(Day))')'}>}INIT_QTY)

VishalWaghole
Specialist II
Specialist II

Hi Loannis,

Try this hope it will help you.

= sum({<Date = {'=$(=addmonths(max(YearEnd(Date)),-12))'}>}INIT_QTY)

It will return INIT_QTY of year end date

- Regards,

Vishal Waghole