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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
spikenaylor1
Creator
Creator

Mixed Dates and times in field

My source field contains the following date and time formats:

Nothing

DD/MM/YYYY hh:mm

DD/MM/YYYY

Date and Time IssuesDate and Time Issues

 

I am struggling to get this into QlikView constistently

 

and loading it as is , the DD/MM/YYYY come in as possible string

Date and Time Issues 1Date and Time Issues 1

I am struggling to get all the dates loaded as dates and not strings

 

Can anyone help or point in the right direction

Regards

 

 

2 Replies
Taoufiq_Zarra

@spikenaylor1  Maye be :

Date(Floor(Alt(Num(Date#(DateField, 'MM/DD/YYYY')), Num(Date#(DateField, 'DD/MM/YYYY hh:mm')))), 'DD/MM/YYYY') as NewDateField

Example :

Data:

load *,
Date(Floor(Alt(Num(Date#(DateField, 'MM/DD/YYYY')), Num(Date#(DateField, 'DD/MM/YYYY hh:mm')))), 'DD/MM/YYYY') as NewDateField inline [
DateField
07/12/2020
04/12/2020
01/01/2021
24/12/2020 18:32
27/12/2020 11:56
]

output:

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉