Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have an excel spreadsheet which unfortunately has the Timestamp column formatted in one of two formats : 02 Apr 2019 09:36 or 02/04/19 3:44:00 PM depending on which source is adding data to the spreadsheet.
I thought I could use the alt function : Timestamp(alt(Timestamp#([DateTime],'DD MMM YY hh:mm'), Timestamp#([DateTime],'DD/MM/YYYY hh:mm')) ,'DD/MM/YYYY hh:mm') AS [DateTime]
but only the dates with the following format 02 Apr 2109 09:36 are transfromed to the correct format. 02/04/19 3:44:00 PM format is blank. Have tried all the combinations of hh:mm:ss TT. To transformed these dates I cannot use the timestamp# function just Timestamp([DateTime],'DD/MM/YYYY hh:mm') AS [DateTime].
Is there any way I can transform both formats in my load script without having to manually reformat the spreadsheet ?
Thanks
Try this may be
TimeStamp(
Alt(
Num(TimeStamp#([DateTime],'DD MMM YY hh:mm')),
Num(TimeStamp#([DateTime],'DD/MM/YYYY hh:mm:ss TT'))
)
, 'DD/MM/YYYY hh:mm') AS [DateTime]
Thanks but did not solve the problem. It seems to be a Qlik to xlsx format issue. If I export the spreadsheet as a csv, my original formula works
Date( DateTime,'DD/MM/YYYY HH:mm:ss')
Thanks but none of the suggestion work when the file is an excel file. When I convert to csv most of the suggestions work. I have managed to get my source to change the format to a csv.