Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner
Partner

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

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
hopkinsc
Partner
Partner
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

View solution in original 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
Partner
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