Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date formatting

I am reading a date from a file.  It comes in as 'May 6, 2014'.  I want to convert it to the numeric format (such as 41051, et al), but cannot seem to get the syntax right.  All I can get it to do is simply show it as it already is...even using the 'Date#' function.

1 Solution

Accepted Solutions
Not applicable
Author

Date:

Load * Inline

[Date

'May 6, 2014'

];

Formated:

Load

num(Date#(Date,'MMM DD, YYYY')) as FormatedDate

Resident Date;

View solution in original post

10 Replies
swuehl
MVP
MVP

What about

=num(Date#('May 6, 2014','MMM D, YYYY'))

tresesco
MVP
MVP

Date#(YourField, 'MMM DD, YYYY')

PrashantSangle

Hi,

Try this,

num(Date(Date#(dateFieldm,'MMM DD, YYYY'))) as DateNum

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
its_anandrjs

Write like

Num(date#('May 6, 2014','MMM D, YYYY'))

Or

Num(date#(YourDateField,'MMM D, YYYY'))



Or



Num(Date(date#('May 6, 2014','MMM D, YYYY'),'MMM D, YYYY'))




Not applicable
Author

Date:

Load * Inline

[Date

'May 6, 2014'

];

Formated:

Load

num(Date#(Date,'MMM DD, YYYY')) as FormatedDate

Resident Date;

ToniKautto
Employee
Employee

What you might want to keep in mind is that all values in QlikView are dual values. this means that if you successfully format a value as a Date, then the visual value will look like a Date while the underlying numerical value will be an integer.

=Date#('May 6, 2014','MMM D, YYYY')

maxgro
MVP
MVP

add this expression in a text box

=num(Date#('May 6, 2014','MMM D, YYYY'))


or this

=Date#('May 6, 2014','MMM D, YYYY')+ 0


and you'll see a number

Not applicable
Author

When I try

Num(Date#(Date, 'MMM,DD,YYYY')))

I get null values.

Not applicable
Author

I fnally got it to work.  In my LOAD statement, I tried this:

(Date#(Date, 'MMM DD, YYYY')) as InterpretedDate,

Thanks for the help!!