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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
Labels (1)
20 Replies
Kushal_Chawda
MVP
MVP

try using alt

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

Chanty4u
MVP
MVP

ankit777
Specialist
Specialist
Author

It did not work

sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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

sunny_talwar
MVP
MVP

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