Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

adoteykwame
Contributor

change 01 AUG 2012 to 01/08/2012 format

Hi

There is a medium date field eg.01 AUG 2012 which i want it in this 01/08/2012 format.

Thanks!

1 Solution

Accepted Solutions
Sokkorn
Honored Contributor

Re: change 01 AUG 2012 to 01/08/2012 format

Hi adoteykwame,

Let consider this expression: Date(Date#('01 AUG 2012','DD MMM YYYY'),'dd/MM/yyyy') return 01/08/2012

So you can try

     1. Expression: Date(Date#(YourDateField,'DD MMM YYYY'),'dd/MM/yyyy')

     2. Load script: Date(Date#(YourDateField,'DD MMM YYYY'),'dd/MM/yyyy') AS [Dates]

Hope this help

Regards,

Sokkorn

7 Replies
sujeetsingh
Honored Contributor III

Re: change 01 AUG 2012 to 01/08/2012 format

Try to use Date() and Date#() functions ...It will help you.

Not applicable

Re: change 01 AUG 2012 to 01/08/2012 format

This seems to work

= DATE(DATE#(Mydate,'DD MMM YYYY'), 'DD/MM/YYYY')

Cheers

nirav_bhimani
Contributor III

Re: change 01 AUG 2012 to 01/08/2012 format

Hi,

Try This,

Num(Month(Date_Field))

Or Else

if(Month='Jan',1,if(Month='Feb',2,if(Month='Mar,3.........))))))))))))

Regards,

Nirav Bhimani

Sokkorn
Honored Contributor

Re: change 01 AUG 2012 to 01/08/2012 format

Hi adoteykwame,

Let consider this expression: Date(Date#('01 AUG 2012','DD MMM YYYY'),'dd/MM/yyyy') return 01/08/2012

So you can try

     1. Expression: Date(Date#(YourDateField,'DD MMM YYYY'),'dd/MM/yyyy')

     2. Load script: Date(Date#(YourDateField,'DD MMM YYYY'),'dd/MM/yyyy') AS [Dates]

Hope this help

Regards,

Sokkorn

martin59
Valued Contributor II

Re: change 01 AUG 2012 to 01/08/2012 format

Hi,

You have to use this expression in your LOAD script :

Data:

LOAD Field1,

     Field2,

     ...,

     Date(Date#(YourDateFied,'DD MMM YYYY'),'DD/MM/YYYY') as Date

FROM Data.qvd (qvd);

Hope that helps you,

Martin Favier

adoteykwame
Contributor

Re: change 01 AUG 2012 to 01/08/2012 format

Thanks alot guys especially Sokkorn Cheav and Martin Grape.


Not applicable

Re: change 01 AUG 2012 to 01/08/2012 format

Hi,

Try This

Month:

MAPPING LOAD * INLINE [

    Month, num

    AUG, 08

];

tab1:

LOAD * INLINE [

    F1

    01 AUG 2012

];

tab2:

LOAD F1,

           Date(Makedate(SubField(F1,' ',3),applymap('Month',SubField(F1,' ',2)),SubField(F1,' ',1)),'DD-MM-YYYY') AS Date

RESIDENT tab1;

DROP table tab1;

Regards,

Vivek

Community Browser