Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need to display only month in number

Hello Friends,

I have a date field, I would like to display only month like

21/01/2010, so I would like to get 01 only, how its possible.

04/11/2012, then I want to get 11 only.

I tried Month(), its giving month name, Please help me out...

Thanks and Regards

Chriss

8 Replies
sivarajs
Specialist II
Specialist II

Use num(month(datefield),'00') or else SubField('21/01/2010','/',2)

er_mohit
Master II
Master II

try this

num(month(date)as num_month

hope it helps

Not applicable
Author

Hello Sivaraj,

Thanks for your reply,

I would like to display the date field in the list box like in the below marked in bold,

so in the script I used Num(Date field) as Num Date

                    and Year(Date field) as Year

and then i concatenate  Year & ' ' & NumDate but it display like 20101, 20102 but I want to show like in the below.

The Main idea is I would like to display the 201001, 201002, 201003 etc.

Thanks

Chriss

Not applicable
Author

hi

Num(Month(Date) )  as monthnumber

hope this helps you helps

sivarajs
Specialist II
Specialist II

We need to give the format for num() to display otherwise it gets round like 01 as 1 .Check the syntax in mentioned in above post

ex: year(Today())&''&num(month(Today()),'00')

Not applicable
Author

Hello Sivaraj,

Thanks a lot, I missed the format '00', that is why its went wrong.

Thanks for your valuable help, and I need one more help. I would like to display the value like

from 1st april 2010 to 31st March 2011 in the list box. How should I do that.

like 201004, 201005, 201006 ..... 201101,201102, 201103.

Kindly help.

Regards

Chriss

er_mohit
Master II
Master II

date(floor(month(Date_field,-1)),'yyyymmdd')

hope it helps

sivarajs
Specialist II
Specialist II

Put it in expression as if(Date>='04/01/2010' and Date<='04/01/2011', year(Date)&''&num(month(Date),'00'))

Date is your date field and check the date format as well