Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between timestamps


I am using the following as an expression to calculate the difference between timestamps, within a straight table

SUM(time(interval( [Delivered Time] - [Deliver By Time]),'h:mm:ss'))

If I try placing the exact same function within a variable and subsequently use the variable within the expression , I get incorrect results, Can anyone please explain why ?

Also is there a possibility to get negative results in case the Delivered Time is < Deliver By Time for the interval function ?

7 Replies
MK_QSL
MVP
MVP

Yes you can get negative values if EndTime is Lower than StartTime

Let us know how you are using this variable in expression...

tresesco
MVP
MVP

Working with variable is interesting. Probably you are missing an '=' symbol in variable declaration. If that is not the case, try to share your sample issue app.

maxgro
MVP
MVP

if you have 2 field I suppose you can use an expression like that

sum( [Delivered Time] - [Deliver By Time] )

and then format as an Interval (hh:mm:ss) in Number tab

Not applicable
Author

Thanks, I was using Interval(EndTime-StartTime)

I have now change that to Interval(StartTime-EndTime) and now I get -ve values

Not applicable
Author

Thanks, I was missing the formatting as interval in the Numbers Tab

Not applicable
Author

Im currently evaluating Qlikview, and have a personal edition , so Im not sure how I can share the app, especially the data within. For the variable I tried using the following inthe expression

=$(varName)

=varName

All rows display the same value, so it appears that whenusing variables , a specific start and end time is being considered and not individual start and end times. Looks like some aggregation is being used

tresesco
MVP
MVP

If you have personal edition, that doesn't stop people access your app with licensed edition. See : Preparing examples for Upload - Reduction and D... | Qlik Community