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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date and Time Merge

Hi All,

I have date in number format in one column and I have time in number format in one column. Now i made the date as date format by using the MakeDate function and  time field as time by using MakeTime function. Same as I have two more fields called NewDate and NewTime. I have to findout the duration between these two dates. for that I need to make the first date and time columns as single field called datetime.... so that i can findout the time gap between these two date&times...... Any help would be appreciated. Thanks in Advance.

first date  first time         second date     second time

1/1/2012  9:40:00am    1/2/2012            9:10:00am

1 Solution

Accepted Solutions
Not applicable
Author

Awesome! Great ..... This helps a lot..... It is working ...... I really appreciate your help.........

View solution in original post

2 Replies
swuehl
MVP
MVP

If you already used Makedate() and Maketime() function to create your field values, creating a Timestamp or DateTime should just be as easy as adding the values for Date and Time. So, to get the gap between second and first Timestamp, you could use

LOAD

...

interval( ([second date]+[second time]) - ([first date]+[first time]) ) as Gap,

...

from Table;

Table is the table that holds the above fields (could also be a resident table or another load that creates the fields).

interval will format the Gap as TimeStamp, using the standard Timestamp format (or state the format as second parameter to the interval function.

Hope this helps,

Stefan

Not applicable
Author

Awesome! Great ..... This helps a lot..... It is working ...... I really appreciate your help.........