Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have some dates in an xml file which are in the format d.m.yyyy hh:mm:ss. An example date is 1.6.2015 21:13:54. Now I want to show this date in the default format of my Qlikview document so that I have converted them like this in the Qlikview script
Date#(StartedAt,'dd.mm.yyyy hh:mm:ss') as testdate1,
date(Date#(StartedAt,'dd.mm.yyyy hh:mm:ss')) as testdate2,
This first one is without casting to date, and the second one is to cast it into local document format. However, when I check the document, they don't seem to be converted correctly. For example, please see the attached image
Can someone please tell me how to correct covert them into local document date format
Regards
Shah
set variable in script
SET TimestampFormat='DD.MM.YYYY hh:mm:ss';
Now load the field as
=timestamp(timestamp#(StartedAt,'DD.MM.YYYY hh:mm:ss'))
That seems to have done the trick. Thanks Antonio and Sunny
Hi,
However, whe You have Timestamp Format it is advisable to use Floor() function to extract Date
e.g.
=Date(Floor(TimeStamp#('1.6.2015 12:01:01','DD.MM.YYYY hh:mm:ss')))
because this doesn't need Windows Apis
Regards,
Antonio