Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Date to integer

hi all, can anyone help me on how to convert a date field (MMM-YYYY) to an interger?

1 Solution

Accepted Solutions
MayilVahanan

HI

=num(Date#('JUL-2013' , 'MMM-YYYY'))

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

11 Replies
Not applicable

num(datefield)

MayilVahanan

Hi

Try like this

= Floor(dateField)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, i am not sure what i am doing wrong but if i create a text box and use =num('JUL-2013') i get null.

rustyfishbones
Master II
Master II

Try this

QC.png

Not applicable

TRY ANY ONE OF THEM

ROUND(dateField)

FLOOR(dateField)

NUM(dateField)

=ROUND(date(today(),'MMM-YYYY' ))

=NUM(date(today(),'MMM-YYYY' ))

OR THIS ONE

=NUM(date(DATEFIELD,'MMM-YYYY' ))

MayilVahanan

HI

=num(Date#('JUL-2013' , 'MMM-YYYY'))

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable

num('JUL-2013')

Here, you are trying to convert a string to number. Qlikview doesn't understand it unless you tell him that it's a date:

num(Date#('11-Jul-2013', 'DD-MMM-YYYY'))

Not applicable

TRY THIS

NUM(DATE#('JUL-2013','MMM-YYYY'))

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Everyone,

Thanks for your replies although i cannot seem to get any of them to work correctly.

I have attached a sample, could someone show me the correct way on the sample please?

So i want the current date format 'JUL-2013' to show the number format (month start)

Thanks