Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Last day of previous year

Hello

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

7 Replies
mov
Esteemed Contributor III

Re: Last day of previous year

YearEnd(today(),-1)

Re: Last day of previous year

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

Re: Last day of previous year

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

Re: Last day of previous year

Ioannis

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

Best Regards,     Bill

Not applicable

Re: Last day of previous year

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
Valued Contributor II

Re: Last day of previous year

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
Valued Contributor II

Re: Last day of previous year

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

Community Browser