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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
skyline01
Creator
Creator

how to trim off time from date

I have a date-time field with values like:

1/1/2018 0:46

10/31/2018 18:00

I need to trim off the timestamp from the date.  So, I used the usual technique: floor(date(field)).  However, I get nulls returning (i.e., it doesn't trim properly).  In fact, when I just use floor(field), I still get nulls.  So, something is wrong with the floor function on my field.  How do I resolve this?

Labels (2)
1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

You might need to add a date function before floor to get it in required format

or
DATE(date#(subfield(field,' ',1),'MM/DD/YYYY'))
Learning never stops.

View solution in original post

2 Replies
pradosh_thakur
Master II
Master II

If your field is a timestamp then floor(field) will do
if is in string format then floor(timestamp(timestamp#(field,'MM/DD/YYYY hh:mm'))) will work.
Learning never stops.
pradosh_thakur
Master II
Master II

You might need to add a date function before floor to get it in required format

or
DATE(date#(subfield(field,' ',1),'MM/DD/YYYY'))
Learning never stops.