Discussion board where members can learn more about Qlik Sense App Development and Usage.
Good, I just recommend using Interval() for this specific need, because it is designed exactly for this type of calculations..
don't forget to close the thread
Thank you here is the sample data,
i have faced an issue, that the left time sometimes is in the next day after 12:00am so the time is negative.
in the sample there is the date as well, so can you create something that will calculate the duration using the date and time,
really appreciate it.
try it again
there is no code, only this expression:
=Interval(Timestamp#([Left Time],'hh:mm')-Timestamp#([Arrival Time],'hh:mm'),'hh:mm')
put your dimensions and use the expression above
it is giving decimal and not working multiplying by 1440
and you didn't react towards the day. as subtracting two times might give negative if in different days.
I wrote something related to the day and I delete it, if you want to include the day, you can do it by concatenating your Day field with your time field inside the Timestamp#() function, like this:
=Interval(Timestamp#([Left Date]&[Left Time],'DD-MM-YYYY hh:mm')-Timestamp#([Arrival Date]&[Arrival Time],'DD-MM-YYYY hh:mm'),'hh:mm')
if this don't solve your problem, take the solution that is working for you