Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ndeeleysww
Creator
Creator

Last Month as just month Name


Hi,

I'm setting some variables in my load script to bring back month names:

SET tThisMonth = Month(Today());

SET tLastMonth = Month(Today())-1;

However, whilst the first variable returns Apr, the second returns 3. I need this variable to be just the month name, as the data I am evaluating has the amount in one column and the month name for that amount in the next. I've tried MonthName but this also returns the year.

Any help gratefully received!

Cheers

Neil

1 Solution

Accepted Solutions
Not applicable

Try this..

Month( AddMonths(Today(),-1))

View solution in original post

5 Replies
jsanchezh
Partner - Creator
Partner - Creator

Maybe you can try this

month(month(today())-1)

Kind Regards

Not applicable

Try this..

Month( AddMonths(Today(),-1))

ndeeleysww
Creator
Creator
Author

That worked! Thank you.

ndeeleysww
Creator
Creator
Author

Sorry - that just returned Jan

anuragprasad
Partner - Contributor II
Partner - Contributor II

You can also try :

Date(Addmonths(today(), -1), 'MMM') for Month name or

Date(Addmonths(today(), -1), 'MMM-YY') for MonthYear