Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
schmidtkm37
Contributor III
Contributor III

Date formatting in load script

Hello,

I'm having an issue formatting a date field coming in from a CSV file. The field is formatted like:

8/9/2020 0:00:00

8/10/2020 0:00:00

10/10/2019 0:00:00

which is causing issues because I can't just take the left 10 characters since sometimes I only need the left 8 and sometimes 9. I've tried using date() and makedate() but nothing has worked. Any suggestions on the best way to get Qlik to recognize this as a date and get it formatted to not include the "0:00:00"? 

Labels (1)
1 Solution

Accepted Solutions
schmidtkm37
Contributor III
Contributor III
Author

Never mind, I got it. I just used left(field,len(field)-8) to trim the right side off and then I was able to use date() to make it a date. 

View solution in original post

2 Replies
schmidtkm37
Contributor III
Contributor III
Author

Never mind, I got it. I just used left(field,len(field)-8) to trim the right side off and then I was able to use date() to make it a date. 

Taoufiq_Zarra

@schmidtkm37 

Maye be :

Date#(subfield(F1,' ',1),'M/D/YYYY') as New_date

 

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") 😉