Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get December of last year as a date?

HI,

I'm trying to set a variable with "Dec 20xx" where xx is last year. I'm able to get last year's year, but if I try to do Date('Dec ' & $(LastYearVar)) it does not work.

Can someone please help me with this. Thanks.

1 Solution

Accepted Solutions
ahaahaaha
Partner - Master
Partner - Master

Hi Andre,

May be

Date(Date#('Dec ' & $(LastYearVar), 'MMM YYYY'))

Regards,

Andrey

View solution in original post

3 Replies
Anil_Babu_Samineni

What was the LastYearVar here?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Like this ?

LET vYear = Year(Today())-1;

LET vVariable  = 'Dec '& $(vYear);

ahaahaaha
Partner - Master
Partner - Master

Hi Andre,

May be

Date(Date#('Dec ' & $(LastYearVar), 'MMM YYYY'))

Regards,

Andrey