Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
asa_runstrom
Contributor III
Contributor III

Problem with month()

Hi

When I write month('2011-01-01') I get the answer 1,2,3,4,5,6,7,8,9,10,11,12 which is not what I want but i works when I write month('2011-02-01') it write feb and with month('2011-03-01') it write mar. How do I do to get jan with month('2011-01-01')? I use developer 8.5.

4 Replies
tresesco
MVP
MVP

Hi,

Have you checked it in a text object? it should work fine. are you trying it with some field value or directly with string as you wrote in the post?

Regards, tresesco

Not applicable

Check the "SET MonthNames" line in your script:





If it contains numbers change it like this:



SET MonthNames = 'jan;feb;mar;apr...'



suniljain
Master
Master



=Month

(Makedate(LEFT('2011-03-01',4),MID('2011-03-01',9,2),MID('2011-03-01',6,2

)))





asa_runstrom
Contributor III
Contributor III
Author

I have tried it in a textobject all 3 on the same time and got the answer 1,2,3,4,5,6,7,8,9,10,11,12 feb mar. I think it is strange that i work with feb and mar but with jan.

I have tried it it with string and with a field value.

This is not in a new application, it has worked severel months but suddenly get the wrong answer for 2011-01-01.