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

Extract time from date time field

I need to extract only the time from a date/time field. Either in the load script (ODBF to informix) to in the properties of the list box. I an trying to group time ranges regardless of the date.

5 Replies
ashfaq_haseeb
Champion III
Champion III

HI,

Try

time(yourdatefield) as Time,

Regards

ASHFAQ

Not applicable
Author

That would work at the list level, but the list still sorts by date first even though only the time is diaplayed. I am trying to group and sort by time only regardless of the date. Probably need to get time extracted at the script level ??

Not applicable
Author

In the Script Load, you can try to create a new time field:

LOAD

   Time(YourDateField) as YourTimeField

   ...

From...

tresesco
MVP
MVP

Time() is a formatting function, hence it doesn't change the underlaying number but the format only. To get the time part only use Frac(), like:

time(frac(yourdatefield)) as Time,

MK_QSL
MVP
MVP

=TIME(FRAC(Timestamp#('17/07/2014 10:30:00','DD/MM/YYYY hh:mm:ss')))

Replace '17/07/2014 10:30:00' with your Date/Time Field

Also, change the  DD/MM/YYYY hh:mm:ss according to your timestamp format