Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Date

I have the date format like this

8/9/2015  12:00:00AM

I want to have only Date like 8/9/2015

How to achieve this at the sript level.

PLease find the attachment below ,with sample Excel file

Thanks in advance

1 Solution

Accepted Solutions
sunny_talwar

Try the attached may be

View solution in original post

11 Replies
sunny_talwar

Try this:

Date(Floor(DateField)) as Date

or this:

Date(Date#(Left(DateField, 8), 'M/D/YYYY'), 'M/D/YYYY') as Date (assuming your date is M/D/YYYY, but if it is not can change it to D/M/YYYY)

smilingjohn
Specialist
Specialist
Author

No its not working

sunny_talwar

Updated my comment to add another option. Can you try the other method

smilingjohn
Specialist
Specialist
Author

HISunny,

Please find the attachment of XL File and QVW ,

I followed your procedure  the date is converting but the master caledar is not working .

Not applicable

Use the following at the start of your qvd script:

SET DateFormat='D/M/YYYY';

sunny_talwar

Try this:

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY  hh:mm:ssTT';

Orders:

LOAD OrderDate as OrderDate,

  Date(Floor(OrderDate)) as Date

FROM

[Date.xlsx]

(ooxml, embedded labels, table is Sheet1);

smilingjohn
Specialist
Specialist
Author

Hi Sunny ,

Now the master calendar is not working

PFA

sunny_talwar

Try the attached may be

senpradip007
Specialist III
Specialist III

Try like

Orders:

LOAD OrderDate,

date(Timestamp#(OrderDate, 'MM/DD/YYYY  hh:mm:ssTT')) as Date

FROM

(ooxml, embedded labels, table is Sheet1);