Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Gartner® Magic Quadrant™: 15 YEARS A LEADER - GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Sxbbb
Creator III
Creator III

Want to calculate time from TimeStartDowntime to TimeFinishDowntime Calculated in minutes by shift.

I have Field 

Sxbbb_0-1724748323684.png

DurationTime(Min) :

Sxbbb_1-1724748391303.png

Sxbbb_2-1724748404670.png

 

Morning shift time 06.00-13.59 hrs. Afternoon shift 14.00-21.59 hrs. Night shift 22.00-05.59 hrs.

Want to calculate time from TimeStartDowntime to TimeFinishDowntime Calculated in minutes by shift.

 

example
TimeStartDowntime ='11:42:40' TimeFinishDowntime ='23:03:38' Want to calculate by shift.


Morning shift StartDowntime ='11:42:40' - '13.59' = ?  Min
Afternoon shift '14.00'- '21.59' = ?  Min
Night shift '22.00 '- FinishDowntime ='23:03:38' = ?  Min


The unit is minutes.

 

 

 

Labels (4)
7 Replies
Kushal_Chawda

@Sxbbb  Do you want Minutes by shift like Morning Shift Minutes, Afternoon Shift minutes.. or do you want overall minutes?

Sxbbb
Creator III
Creator III
Author

want Minutes by shift like Morning Shift Minutes, Afternoon Shift minutes..

Sxbbb
Creator III
Creator III
Author

Do I have to do field shift as well?

Padma123
Creator
Creator

for minutes difference-

((Hour(TimeFinishDowntime))*60+Minute(TimeFinishDowntime))
-
(( Hour(TimeStartDowntime))*60+Minute(TimeStartDowntime))

for shifts wise use interval match

Sxbbb
Creator III
Creator III
Author

I want to bring time TimeStartDowntime to TimeFinishDowntime is divided into shifts. What should I do?

I need shift field  = Morning Afternoon Night 

EX 

Sxbbb_0-1724811734819.png

What do I have to do?

Sxbbb
Creator III
Creator III
Author

EX 

Sxbbb_1-1724812330997.png

The shifts are morning, afternoon, and night.

Padma123
Creator
Creator

I hope it is helpful

table1:
load *,Hour(timedown) as hourtimedown,
Minute(timedown) as mintimedown,
    Hour(timestart) as hourtimestart,
    Minute(timestart) as minutestimestart;
 
load * inline [
timestart,timedown
06.00.00,13.00.00
06.00.00,07.00.00
14.00.00,15.00.00
]
;
 
 
shift:
load * inline [
shiftstart,shiftend,shift
06.00.00,13.59.00,morning
14.00.00,21.59.00,after
22.00.00,05.59.00,nyt
];
 
 
IntervalMatch(timestart)
load shiftstart,shiftend
Resident shift;