Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

clauriayang
New Contributor

Month function returns month number instead of the month name?

Hello,

I have an expression:

month(addmonths(MakeDate(1900,month(date#((GetFieldSelections([Month])),'MMM')),1),-1))

The Month field is the three-letter month name. What i want is to getthe month name of last month. The expression gives me the correct month number in integer. Shouldn't month()  return a month name?

Please help.

Thank you.

2 Replies

Re: Month function returns month number instead of the month name?

I tried this and I got three letter month name:

=month(addmonths(MakeDate(1900,month(date#('Feb', 'MMM')),1),-1))

Capture.PNG

Can you check your environmental variables? Do you have this?

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

or do you have this?

SET MonthNames='1;2;3;4;5;6;7;8;9;10;11;12';

clauriayang
New Contributor

Re: Month function returns month number instead of the month name?

My environmental variables setting is the first one, but i am still getting a number not the real name. Month function works fine if i just use it with a date.

Community Browser