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

Problem with negative time

Hello everybody,

I'm having problems with this:

I have a table with 2 columns with entry times (Hora_ing) and out times (Hora_sal).

When i do the subtraction of Hora_sal and Hora_ing it works.

Captura de pantalla 2015-11-19 a las 4.56.37 p.m..png

But when the "truck" come to the place at 23:00:00 pm and lives at 00:00:01 am and after, my problem starts.

                                                     Hora_sal                                      Hora_ing

Captura de pantalla 2015-11-19 a las 4.49.26 p.m..png

the fields in blue are expression Hora_sal - Hora_ing and the times are negative and i need positives values, im trying to make a expression like:

if(Hora_sal-Hora_ingr < time#(00,'hh'), Hora_sal-Hora_ing = (Hora_sal-Hora_ing) + 24 ) and other stuffs but nothing works to me.

Regards,

Gerd Neumann

1 Solution

Accepted Solutions
sunny_talwar

Yes just do it like this:

Time(EndTimeStamp - StartTimeStamp, 'hh:mm:ss')

View solution in original post

7 Replies
oknotsen
Master III
Master III

Do you still have the timestamps of which you based the times? If so, use those for your calculation.

May you live in interesting times!
sunny_talwar

I think it would be better if use a TimeStamp (which include date field) to do this calculation because then it would know if it is the next day you are subtracting it for. Do you have a field which specifies date?

Not applicable
Author

the original Excel data, has a column with data and time, and i separate it into 2 columns.

You suggest to use the original column

Captura de pantalla 2015-11-19 a las 5.29.22 p.m..png

regards,

Gerd Neumann

Not applicable
Author

yes i have in other column, but i dont know how to use it

sunny_talwar

Yes just do it like this:

Time(EndTimeStamp - StartTimeStamp, 'hh:mm:ss')

Not applicable
Author

Thank you very much!! it works for me!

Regards,

Gerd Neumann

sunny_talwar

Awesome