Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Convert Number Format Date value in Date format value

we picked Date in number format in Qlik,but I want to create Year and Month field from this Date value.


Example-->

I have date in (201402,201408,201409,201306,201305,201208) this format.

it is numerb format.

I tried all possibel value but I'm not able to get Year and Month from ablve value.

Please provide sol or formula for this

5 Replies
mdmukramali
Specialist III
Specialist III

Dear,

can you try something like below,

LOAD *,Left(Data,4) as Year,

Right(Data,2) as Month

Inline

[

Data

201402

201408

201409

201306

201305

201208

]

;

                                       

Thanks,

Mukram

Not applicable
Author

I did not understand your question. Is this what you need?

=left(201402,4)=> 2014

= Right(201402,2) = 02

ashfaq_haseeb
Champion III
Champion III

Try like this

=Month(MakeDate(left(201402,4),right(201402,2),1)) as Month

=Year(MakeDate(left(201402,4),right(201402,2),1)) as Year

Regards

ASHFAQ

MarcoWedel

Hi,

one possible solution could be also:

QlikCommunity_Thread_137539_Pic1.JPG.jpg

LOAD *,

    Month(MonthName) as Month,

    Year(MonthName) as Year,

    QuarterName(MonthName) as QuarterName;

LOAD Date#(Date, 'YYYYMM') as MonthName

INLINE [

    Date

    201402

    201408

    201409

    201306

    201305

    201208

];

hope this helps

regards

Marco

Not applicable
Author

Hiii Ganesh,

First interpret this number format into Date format like this:-

Date#(Date,'YYYYMM') as Date

and then perform any operation with that date like:

year(Date) as Year,

month(Date) as Month

Complete Script is like:-

Load year(Date) as Year,month(Date) as Month;

Load Date#(Date,'YYYYMM') as Date;

Thanks & Regards

Prince Anand