Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show only valid times from Date/Time field

Hi everyone,

I am trying to work out how I can have a field in my load script which filters out midnight times.

The field is a date time stamp from SQL which if left blank canbe either blank (NULL) or be the date with a midnight time. What I would like to do is strip the date away and leave the time, only if the time is not midnight (the chances of it actually being midngiht are quite remote in this case).

Does anyone have a suggestion?

Many thanks in advance. 

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe

...

if(frac(DATETIMESTAMP)>0, time#(time(DATETIMESTAMP))) as TIME,

...

Hope this helps,

Stefan

View solution in original post

3 Replies
swuehl
MVP
MVP

Maybe

...

if(frac(DATETIMESTAMP)>0, time#(time(DATETIMESTAMP))) as TIME,

...

Hope this helps,

Stefan

Not applicable
Author

Hi Stefan,

Thanks for the expression, I have tested it on a table and it works great. I don't think I would have been able to work that one out on my own.

Many thanks

Regards

Jason_Michaelides
Partner - Master II
Partner - Master II

Phil - don't forget to mark Stefan's answer as correct.

Jason