Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Change text to date

Hi all,

Unfortunately my data source has a "date" field that is text with the following format, ie, October 15, 2012.

How do I make this into a date? I think it would be easier if the Month was standard 3 letters across the board so I could do something to the effect of: date(date#('date', 'MMM/DD/YYYY')) as New_Date but it doesn't seem to work.

Any suggestions? Do I need to nest a ton of left, mid, rights, find(","), etc? Thanks so much.

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: Change text to date

check this:

=makedate(right(olddate,4),match( left(olddate,index(olddate,' ')-1),'January', 'February','March','April','May','June','July','August','September','October','November','December'),right(left(olddate,index(olddate,',')-1),index(olddate,',')-1-index(olddate,' ')-1))

3 Replies
Not applicable

Re: Change text to date

check this:

=makedate(right(olddate,4),match( left(olddate,index(olddate,' ')-1),'January', 'February','March','April','May','June','July','August','September','October','November','December'),right(left(olddate,index(olddate,',')-1),index(olddate,',')-1-index(olddate,' ')-1))

Re: Change text to date

Hi,

Format is available for the full month name also.

Please check this

Date(Date#(datefield, 'MMMM DD, YYYY'))

Hope it helps

Celambarasan

Not applicable

Re: Change text to date

This worked, thanks

Community Browser