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: 
Anonymous
Not applicable

Want to separate Date and time in in the same field

Hi All,

I have field StartDateTime in that i have DATE&Time (12-06-1978 00.03) now i want to separate the Date and time and display in the screen

Help on this.

Thanks & Regards,

Sivakumar

1 Solution

Accepted Solutions
maxgro
MVP
MVP

=date(FLOOR(DATE#('12-06-1978 00.03', 'DD-MM-YYYY hh.mm')), 'DD-MM-YYYY')

=time(frac(DATE#('12-06-1978 00.03', 'DD-MM-YYYY hh.mm')), 'hh.mm')

View solution in original post

4 Replies
maxgro
MVP
MVP

=date(FLOOR(DATE#('12-06-1978 00.03', 'DD-MM-YYYY hh.mm')), 'DD-MM-YYYY')

=time(frac(DATE#('12-06-1978 00.03', 'DD-MM-YYYY hh.mm')), 'hh.mm')

Anonymous
Not applicable
Author

Dear Massimo,

Tried with the query but i have around 50000 records then to iam getting the display like

11/08/1978 00.03 - 00.03 want to display in like 11/08/1978 in field Date and 00.03 in another field called time

Thanks & Regards,

Sivakumar

maxgro
MVP
MVP

in the script may be

load

     ...

     yourdatefield,        

     date(FLOOR(DATE#(yourdatefield, 'DD-MM-YYYY hh.mm')), 'DD-MM-YYYY') as newdate,

     time(frac(DATE#(yourdatefield, 'DD-MM-YYYY hh.mm')), 'hh.mm') as newtime,

     .......

from

     .....

aveeeeeee7en
Specialist III
Specialist III

Hi sivakumar

Create 2 fields using Subfield function. Try this in your Script :

Subfield(NUM(DATE(StartDateTime,'DD-MM-YYYY')),'.','1') AS StartDate


Subfield(NUM(DATE(StartDateTime,'DD-MM-YYYY')),'.','2') ASTime



Hope that resolves your problem.


Regards

Aviral Nag