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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

date statment

hello can any one help me whats going wrong in my statement please

table:

LOAD * INLINE [

    orderdate

    02-01-2015

    02-03-2015

    02-05-2015

    02-09-2015    //mm-dd-yyy

    31-02-2015   //dd-mm-yyyy

    28-02-2015

];

load date#(orderdate,'MM-DD-YYYY') as date1

Resident table;

4 Replies
sunny_talwar

So your date is formatted DD-MM-YYYY and MM-DD-YYYY? How would you determine if something like 02-09-2015 is always going to be MM-DD-YYYY what if for this one time it is DD-MM-YYYY. I think you need to give more information before we can guide you.

Best,

Sunny

MarcoWedel

Hi,

something like

table:

LOAD *,

     Date(Alt(Date#(orderdate,'MM-DD-YYYY'),Date#(orderdate,'DD-MM-YYYY'))) as orderdate2

Inline [

    orderdate

    02-01-2015

    02-03-2015

    02-05-2015

    02-09-2015

    28-02-2015

    27-03-2015

    28-03-2015

    03-29-2015

    03-30-2015

    03-31-2015

];

would deliver a result for both input date formats (formatted using your default DateFormat), but like Sunny already pointed out, there are ambiguous values that might lead to wrong results.

QlikCommunity_Thread_194328_Pic1.JPG

hope this helps nevertheless

regards

Marco

kunkumnaveen
Specialist
Specialist
Author

Hello Sunny T,what i was thinking, is it possible to change the date which is in dd-mm-yyyy to mm-dd-yyyy and display the entire orderdate field in one single formate instead of two formates..u known what i mean  to say.....

it was just a general doubt which had rise in me mind,i dont known whether this is a appropriate question or not

anyway thanks for your replays for my posts man

kunkumnaveen
Specialist
Specialist
Author

Hello Marco Wedel ,thanks for your reply ,now i can change the entire orderfield in to single formate instead of having two formats thanks man