Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
priyav24
Creator II
Creator II

How to convert date format "CYYMMDD" to "DD /MM /YYYY"?

Hello Everybody,

                    My client is using DB2 .So am developing qlikview dashboard with DB2 as Datasource.They have the date format

"CYYMMDD"

where C-Represents century .

I want this to be converted into the "DD /MM /YYYY".Currently am using below expression for this

=date(date#(right(Field Name,6),'YYMMDD'),'DD/MM/YY')

Currently am converting('CYYMMDD' to 'DD/MM/YY')

which is working fine but i want to convert  'CYYMMDD'  to  'DD /MM /YYYY'

Thanks in Advance,

Priya

11 Replies
priyav24
Creator II
Creator II
Author

Thanks @Pierre de calan

Not applicable

Hi all,

In my case, I got a date format of DD-MM-YY without the century.

So I had to specify which dates fall in the 20th century and which ones fall in the 21st century, with an if condition, like below:

Date(Date#(

     if(Right(DateField, 2) >= 40,

      Left(DateField,6) & '19' & Right(DateField,2)

      ,

      Left(DateField,6) & '20' & Right(DateField,2)

),'DD-MM-YYYY'), 'DD/MM/YYYY') as DateFieldAdjusted

Would there be another way to do that ?