Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
DanaL
Creator
Creator

Wrong interval between times

Hi People,

I am trying to calculate an interval based on the following

 Timetamp: 10/11/2019 12:53:14  

My expression:

Interval(Time(Maketime(18,00,00))-Time(Timetamp))

The result:

-1050690:53:14

What am I doing wrong?

Thanks!

 

Labels (1)
1 Solution

Accepted Solutions
RsQK
Creator II
Creator II

Hi, try this script:

temp:
LOAD *,
INTERVAL(MAKETIME(18,0,0)-time) as time_diff;
	
LOAD *,
TIME(FRAC(timestamp_field)) as time;

LOAD
TIMESTAMP(TIMESTAMP#(timestamp_field,'DD/MM/YYYY hh:mm:ss')) AS timestamp_field
INLINE [
timestamp_field
10/11/2019 12:53:14
10/11/2019 13:41:10
10/11/2019 17:17:53
]
;

View solution in original post

2 Replies
RsQK
Creator II
Creator II

Hi, try this script:

temp:
LOAD *,
INTERVAL(MAKETIME(18,0,0)-time) as time_diff;
	
LOAD *,
TIME(FRAC(timestamp_field)) as time;

LOAD
TIMESTAMP(TIMESTAMP#(timestamp_field,'DD/MM/YYYY hh:mm:ss')) AS timestamp_field
INLINE [
timestamp_field
10/11/2019 12:53:14
10/11/2019 13:41:10
10/11/2019 17:17:53
]
;
DanaL
Creator
Creator
Author

It works!

Thanks a lot!