Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ankit777
Specialist
Specialist

Irregular Date format

Hi All

I have date format like shown below. How should I read this in QV.

Date:  

14/5/2016
04/05/16
29/4/2016
01/05/16
30/4/2016
31/5/2016
29/4/2016
27/4/2016
03/05/16
30/4/2016
20 Replies
Kushal_Chawda

try using alt

=date(alt( Date#(DateField,'DD/MM/YYYY'),Date#(DateField,'DD/MM/YY')),'DD/MM/YYYY')

ankit777
Specialist
Specialist
Author

It did not work

sunny_talwar

I believe that this alone seems to be working:

SET DateFormat='DD/MM/YYYY';

Table:

LOAD Date(@1) as Date

FROM

[https://community.qlik.com/thread/217289]

(html, codepage is 1252, no labels, table is @1);

Kushal_Chawda

what is the format of you Date? As per your snapshot, I can see date format 'DD/MM/YYYY' and 'DD/MM/YY', so below should work

LOAD Date,

date(alt( Date#(DateField,'DD/MM/YYYY'),Date#(DateField,'DD/MM/YY')),'DD/MM/YYYY') as Date

....

FROM Source

sunny_talwar

Kush -

Have you looked at the sample I posted? We might not even need to use Alt() function here. Look at this discussion we had yesterday:Re: date format - includes a . and read marcowedel‌'s response

Kushal_Chawda

What if the data is coming as string format from source(QVD or Excel)?

sunny_talwar

I have not tested this, but if you specify this -> SET DateFormat='DD/MM/YYYY'; at the top, QlikView should be able to read string as date as well (assuming that the string is either DD/MM/YYYY or DD/MM/YY)

ankit777
Specialist
Specialist
Author

issue was same. I was getting string instead of dates. Thanks for help