Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcohadiyanto
Partner - Specialist
Partner - Specialist

Interval between time start and end

Hi All,

i'm trying to get interval between time start and time end (StartTime) - (EndTime), my time format is 24 hours. when StartTime greater than EndTime, it's fine, but  if EndTime greater than StartTime, the interval function always doing the minimum interval.

ex 1:

StartTime : 10:00:00

EndTime : 12:00:00

interval : 2:00

---------------------------------> it's work perfect it's calculate between 10AM to 12 PM.

ex2:

StartTime : 10:00:00

EndTime : 02:00:00

interval 8:00

--------------------------------->it's Error because it's only calculate between 10AM to 2AM. the result i want is 16:00

what's expression to make this interval correctly?

regards,,

Marco

23 Replies
marcohadiyanto
Partner - Specialist
Partner - Specialist
Author

hi,

i want to sum the interval of time that you solve before,

Start Time : Time#(num(Only({<STAGR={'MTBJOS'}>}SMEBTR)*100,'0000'),'hhmm')

End Time :Time#(num(Only({<STAGR={'MTBJOF'}>}SMEBTR)*100,'0000'),'hhmm')

i want to sum the value of interval between Starttime and Datetime.

Regards,

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Have you tried with this

     Without the sum in the expression what result your getting?Why going for sum?Can you tell me a brief about that?

Celambarasan

marcohadiyanto
Partner - Specialist
Partner - Specialist
Author

Hi,

the data something like this,

MonthDaySTAGRSMEBTR
11Start1000
11End 1200
12Start1200
12End 1800
23Start1300
23End 200
23Start1000
23End 500

after i get the result interval time for each day, now i want to calculate total for 1 month.

Regards,

Marco

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with this

       =Sum(aggr(Expression,Day,Month))

Celambarasan