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

Substracting time (it includes date and time in field)

i need to perform the substraction inorder to know the time consumed. the time format  includes both date and time in the field..

field value is in the format ''02.05.2013  08:03:43'' in excel

and other field value is ''02.05.2013  08:25:12''

the result must be below value minus upper value , which is : ''00:21:29''

1 Solution

Accepted Solutions
Not applicable
Author

Answer is :  Interval(Fieldname-previous(fieldname),hh:mm:ss')

View solution in original post

7 Replies
Not applicable
Author

try this

=Interval(date#('02.05.2013 08:03:43','DD.MM.YYYY hh:mm:ss')-Date#('02.05.2013 08:25:12','DD.MM.YYYY hh:mm:ss'))

Sokkorn
Master
Master

Hi,

Have you try this yet

=Interval(

Date(Date#('02-05-2013 08:25:12','dd-MM-yyyy hh:mm:ss'),'dd-MMM-yyyy hh:mm:ss')-Date(Date#('02-05-2013 08:03:43','dd-MM-yyyy hh:mm:ss'),'dd-MMM-yyyy hh:mm:ss')

,'hh:mm:ss')

Regards,

Sokkorn

Not applicable
Author

=Interval(Date#('02.05.2013 08:25:12','DD.MM.YYYY hh:mm:ss')-date#('02.05.2013 08:03:43','DD.MM.YYYY hh:mm:ss'),'hh:mm:ss')

Not applicable
Author

Hi qlikviewgeek

if your problem resolved then marked it as either correct or helpful according to your question , and close this thread,so that it might be helpful for other developer.

Regards

vishwaranjan

Not applicable
Author

probelm is not yet solved. Here date field is dynamic. how to do in that case. and i am using previous function to get the date of the previous date. for ex. interval(date#(pm_date)-date#(previous(pm_date)) as required hours. i need in this format, but unfortunately its not working.

Not applicable
Author

try this

Time:

LOAD Interval(timestamp#(pm_date,'DD.MM.YYYY hh:mm:ss')-timestamp#(Previous(pm_date),'DD.MM.YYYY hh:mm:ss'),'hh:mm:ss')  as required_hours,

* INLINE [

pm_date

    02.05.2013 08:03:43

    02.05.2013 08:25:12

    03.05.2013 09:07:43

    03.05.2013 09:15:23

];

Not applicable
Author

Answer is :  Interval(Fieldname-previous(fieldname),hh:mm:ss')