Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gshockxcc
Creator
Creator

Problem separating Date and Time

I found several other posts regarding the separation of date and time from a single field.  I implemented a method that appears to work, but only captures a few dates from all the available data. 

Any help would be appreciated.

Please see attached file.  Thanks.

1 Solution

Accepted Solutions
rubenmarin

Hi Kristan, in subfield funtion you have to use [Date Time] instead of DateTime.

View solution in original post

4 Replies
datanibbler
Champion
Champion

Hi Kristan,

your DateTime field seems to be a Timestamp?

That is saved internally as a numeric value (decimal value). So you can use the Floor() and Frac() functions to split it - Floor() will get the day and Frac() will get the time out of that.

Then you can use the DATE() or TIME() functions to format it and, for instance, have only the hours (out of the time) displayed.

HTH

Best regards,

DataNibbler

rubenmarin

Hi Kristan, in subfield funtion you have to use [Date Time] instead of DateTime.

tresesco
MVP
MVP

Try like:

Load

          Date(TimeStamp#(DateTime, 'MM/DD/YYYY hh:mm:ss')) as Date,

          Hour(TimeStamp#(DateTime, 'MM/DD/YYYY hh:mm:ss')) as Hour,

          Minute(TimeStamp#(DateTime, 'MM/DD/YYYY hh:mm:ss')) as Minute,

          Second(TimeStamp#(DateTime, 'MM/DD/YYYY hh:mm:ss')) as Second

gshockxcc
Creator
Creator
Author

Ruben,

     Perfect.  That small change, and it worked like a charm.  Exactly what I needed.  Thank you.