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

Remove time from a date field

I have a date field with the format as 01/01/2020, 00:00 AM

I want it to only be the date, with no time. I have looked up many forum posts, but nothing recommended seems to work.

date.png

For the above data,

date#(Num#([Closed Date]), 'DD/MM/YYYY')

is not working, it still has the time appended on.

Any ideas?

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Yes so after you get that ClosedDateNum do a Preceding load again as mentioned above.

Date(ClosedDateNum, 'MM/DD/YYYY')  AS ActualDate;

View solution in original post

8 Replies
Not applicable
Author

A solution in the load script would be preferred as well

vishsaggi
Champion III
Champion III

May be this?

LOAD *,

          Date(ClosedDate, 'MM/DD/YYYY') AS ClosedDate1;

LOAD *,

Num(Floor(Subfield(ClosedDate, ',', 1))) AS ClosedDateNum

From ....;

Not applicable
Author

I tried that but got this what.png

Not applicable
Author

I have attached test data with excel. Hope this helps

vishsaggi
Champion III
Champion III

Yes so after you get that ClosedDateNum do a Preceding load again as mentioned above.

Date(ClosedDateNum, 'MM/DD/YYYY')  AS ActualDate;

vishsaggi
Champion III
Champion III

Try this with your excel sheet.

LOAD *,

     Date(ClosedDateNum, 'MM/DD/YYYY') AS ActualDate;

LOAD [Closed Date],

     Num(Floor(Subfield([Closed Date], ',', 1))) AS ClosedDateNum

FROM

test.xlsx

(ooxml, embedded labels, table is Sheet1);

Not applicable
Author

Thanks! This helped greatly

vishsaggi
Champion III
Champion III

No problem at all.