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: 
Not applicable

Problem editing Dates

Hello,

Im currently loading a file from excel that has a colum of Date with this format 08.01.2014 21:13, and im not sure how to edit this on the script so i only have the Date without the hour. Or even maybe a field with Date and another with hour, or a field that i can use Week(Date) and even if it has the hour it'll work.

I've currently tryed to use Date(field,'DD/MM/YYYY') and it doesn't work.

Anyone can knows how to do this?

thanks,

1 Solution

Accepted Solutions
Nicole-Smith

I'm not sure if you can have a time stamp in the date#() function.  You may need to use (and note that the floor will take the time stamp away):

date(floor(timestamp#(YourField, 'DD.MM.YYYY hh:mm')), 'DD/MM/YYYY')

View solution in original post

4 Replies
Not applicable
Author

Maybe try date(date#(field, 'DD.MM.YYYY hh:mm'), 'DD/MM/YYYY')

Nicole-Smith

I'm not sure if you can have a time stamp in the date#() function.  You may need to use (and note that the floor will take the time stamp away):

date(floor(timestamp#(YourField, 'DD.MM.YYYY hh:mm')), 'DD/MM/YYYY')

Not applicable
Author

Date:

LOAD * INLINE

[

Date

08.01.2014 21:13

];

Final:

Load

date(date#(Date, 'DD.MM.YYYY hh:mm'), 'DD/MM/YYYY') as FinalDate

RESIDENT Date;

DROP TABLE Date;

This works so I believe date#() recognizes a time stamp.

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

I think this is not the most elegant solution but it works:

date(date#(left(TimestampField, 10), 'DD.MM.YYYY'), 'DD/MM/YYYY')