Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a date from a 6 digit code

Good day,

I want to convert the REGISTRATION_MONTH_CODE into a date with the following format YYYY/MM/DD.

the first four numbers are a Year, next two are a month and then I will add 01 as the day.

1.jpg

Your assistance will be highly appreciated.

Kind regards,

Mzoxolo Mbini

3 Replies
Chanty4u
MVP
MVP

hi,

Load*,

Date(Date#(Datefield,'YYYYMMDD'),'YYYY/MM/DD') AS newdate

resident oldtable;

Chanty4u
MVP
MVP

check sample example:

aa:

LOAD * INLINE [

    Dat

    20140812

   20140611

    20140410

];

Result:

LOAD *

,

date(Date#(Dat,'YYYYMMDD'),' YYYY/MM/DD') as newdate

Resident aa;

new.PNG

its_anandrjs

Try with this

Load

REGISTRATION_MONTH_CODE

Date(REGISTRATION_MONTH_CODE,'YYYY/MM/DD') as New_REGISTRATION_MONTH_CODE

From Location;

Note:- Be insure you have proper date format for the field REGISTRATION_MONTH_CODE

if not then try with this

Date(Date#(REGISTRATION_MONTH_CODE,'YYYYMMDD'),'YYYY/MM/DD') as New_REGISTRATION_MONTH_CODE

Regards,

Anand