Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the numero of the month in a date

Hello everyone,

Does someone know how to get the numero of a month from a date ?

For example, if I have 26/12/1990, how can I get 12 ?

I tried several thing but each time I end up with December instead of 12..

I need this because in some expressions, I need to be able to do something like " Month -1" to use the values of the previous month and so on...

Thank you for your help

1 Solution

Accepted Solutions
alex_millan
Creator III
Creator III

Hi Laura,

Try this out:

     Num(Month(Date))

See if it works,

Cheers,

View solution in original post

5 Replies
its_anandrjs

You can get this from

Mid(Datefield,4,2) as Month

Eg:-

Mid('26/12/1990',4,2) as Month

Hope this helps

Thanks & Regards

alex_millan
Creator III
Creator III

Hi Laura,

Try this out:

     Num(Month(Date))

See if it works,

Cheers,

its_anandrjs

If your datefield is in proper date format then use

Month(datefield) as Month

or

Num(Month(datefield)) as NumMonth

Hope this helps

Thanks & Regards

MK_QSL
MVP
MVP

Try

NUM(Month(Date)) as MonthNO

in script.....

or

NUM(Month(Date))

is UI

Not applicable
Author

thanks a lot to all of you Guys !

I didn't know the num function..