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: 
Jacco_De_Zwart
Creator
Creator

Unparsable date/time

Hi all,

Yes an other Unparsable date/time question here. I know, there are a lot out there, but I could not find any suitable for my case.

I get date/time values. In a tExtractJSONFields I'm able to get most of them with format

"yyyy-MM-dd'T'HH:mm:ss.SSSSSS"

But. . . . .  this fails when a date/time has (for example) the following value :

2025-11-12T17:29:36

No miliseconds, no dot what so ever.

 

How to handle vlaues like these ???

 

Thanks in advance.

 

Jacco

Labels (2)
4 Replies
brunobertels
Master
Master

Hi 

use Alt() fonction that allow to test different datetime timestamp format 

 

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFun... 

 

hope it helps 

mikaelsc
Specialist
Specialist

if all your values have at least "yyyy-MM-dd'T'HH:mm:ss", why not

left(datetimevalue,21) and continue with that? 

 

otherwise, somethging combining left(datetimevalue,28) & repeat('0',28-len(datetimevalue) )

(max length supposed to be 28... ) 

Shicong_Hong
Employee
Employee

@Jacco_De_Zwart 

I suggest reading this field as a string type, then checking the length of the data and parsing the string data into a Date value using the corresponding date pattern on other component such as tJavaRow after ttExtractJSONFields.

Regards

Shicong

Nagaraju_KCS
Specialist III
Specialist III

Try this

Alt(
Timestamp#([Timestamp], 'YYYY-MM-DDThh:mm:ss.SSSSSS'),
Timestamp#([Timestamp], 'YYYY-MM-DDThh:mm:ss')
) AS DateTime