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

Month number out of date

Hello all,

How can I extract the month number out of a date field in a calculated field?  I tried this expression, but it won't work:

=Month(Date([DateField]))

I get the month's short name even though I discarded the variable declaration at the beginning of my script:

/*SET MonthNames='janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.';*/

Can anyone help?

Thanks.

4 Replies
krishna_2644
Specialist III
Specialist III

num(Month(Date([DateField])))

alkyde01
Contributor II
Contributor II
Author

Thank you Krishna!

alkyde01
Contributor II
Contributor II
Author

Do you know how I could get the month number to look like 01, 02, 03, 04 ... 10, 11, 12? Thanks again.

jerifortune
Creator III
Creator III

Try num(Month(Date([DateField])),'00')
OR Num(Date(DateField,'MM'),'00')