Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

seperate data and time from the dateTimestamp

Hi All,

I'm trying to seperate date and time into 2 diff. fields form DateTimeStamp value.

EG:

8/31/15 1:00 AM

into

  • MyDate
8/31/15

  • MyTime

        1:00 AM

Pls find attached applciation

1 Solution

Accepted Solutions
sunny_talwar

Try this:

LOAD *,

  Date(Floor(TimeStamp)) as Date,

  Time(Frac(TimeStamp)) as Time;

LOAD TimeStamp#(Test, 'M/D/YY h:mm TT') as TimeStamp,

  Test;

LOAD * Inline

[

Test

8/30/15 8:50 PM

8/30/15 11:40 PM

8/31/15 12:15 AM

...

];

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

Try this:

LOAD *,

  Date(Floor(TimeStamp)) as Date,

  Time(Frac(TimeStamp)) as Time;

LOAD TimeStamp#(Test, 'M/D/YY h:mm TT') as TimeStamp,

  Test;

LOAD * Inline

[

Test

8/30/15 8:50 PM

8/30/15 11:40 PM

8/31/15 12:15 AM

...

];

Capture.PNG

sunny_talwar

Or this:

SET TimeFormat='h:mm TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YY h:mm TT';

LOAD *,

  Date(Floor(Test)) as Date,

  Time(Frac(Test)) as Time;

LOAD * Inline

[

Test

8/30/15 8:50 PM

8/30/15 11:40 PM

8/31/15 12:15 AM

...

];


Capture.PNG

markgraham123
Specialist
Specialist
Author

Thanks a lot Sunny

sunny_talwar

Not a problem Mark. I would suggest going through this link to understand why QlikView is unable to understand dates sometime. Why don’t my dates work?‌ and Get the Dates Right‌. Once you will have this concept cleared out, you will never have any issues with dates.

markgraham123
Specialist
Specialist
Author

Perfect brother!

This would help me to understand more!!!