MS Project - Assign a resource to multiple tasks that take place on the same day - project

I have a number of tasks that all are 1 day in duration and take place on the same day. I want to assign a resource to these tasks but only have it calculate for 1 day - it currently calculates 8 hours for each task (even though they're on the same day) for the resource.

Insert the "Work" column. Do this BEFORE you assign resources to the task. Let us assume that you have 4 one -day tasks--all on same day--and you wish to have "Bob" Work on these tasks. So, enter "2 Hours" in the Work column for all 4 tasks. THEN, assign Bob to all 4 tasks. Bob's total Work for the day will be 8 hours.

Related

Employee shift scheduling optimization of multiple constraints

I am working on filling a daily schedule. During each day there are a number of tasks that have different shift lengths. For example, task_1 has three 8 hour shifts during a 24 hour period and task_2 has six 4 hour shifts during a 24 hour period. There is also a task which is only done during certain hours and consists of four 4 hour shifts during a 24 hour period.
On top of that, certain tasks require a group of employees with different experience levels. Employees can either be simple workers or team leaders. The group of employees is divided into three teams where each team consists of a number of leaders and workers. A constraint I have is that for tasks that require multiple employees , the employees need to be from the same team. For example, group_1 consists of 2 leaders and 3 workers [leader_1, leader_2, worker_1, worker_2, worker_3]. Task_1 requires a team leader and two employees and they need to be from the same group. I can schedule [leader_1, worker_1, worker_2] to the first shift but for the second shift I would only have 1 leader and 1 worker and would need to schedule employees from another group.
I am trying to schedule employees so that there is a maximum amount of time between shifts, i.e. they have as much downtime between shifts as possible. I'm hoping to find a way to automate the scheduling and have been looking at examples of or-tools and pyomo. Right now I don't even have an example code since I'm trying to understand if what I am trying to do is possible with the amount of variables and constraints I have.
Any help would be much appreciated!

I would like to know if there's a way to complete this query

I'm trying to obtain the average time of an "activity" in a moodle database, i am not an sql expert, but i have managed to get to the point showed in the picture, my question is if exists a way to obtain, first the timestamp/time difference (this "activity" does not have a starting time column like many others) by day and then sum them all to get the average of that activity , for the first i tried with the function 'EXTRACT()' and comparing the dates in the format "%Y-%m-%d" but only sums the first row where they are equal, by the way i have been doing this just by a sql statement, i know the existence of store procedures but my level of sql is not that high.
Thanks in advance!
data obtained so far
Data on table logs (the most important i think)
component
action
objecttable
userid
courseid
timecreated
mod_quiz*
viewed
quiz_attempts
6
2
1645287525
mod_forum
viewed
forum
5
2
1645288525
core
loggedout
user
2
0
1645291745
mod_page
viewed
page
5
2
1645291955
Data i've trying to get:
Activity
StartTime
EndTime
Total
forum
19:01
19:10
9 minute(s)
quiz
15:45
16:00
15 minute(s)
page
...
...
...
workshop
...
...
...
but so far i get to assort the data in a column
Time
2022-x-x h:m
....
but when i try to sum by day with the function EXTRACT() and trying to match the dates in a very long query it just get the first record.
NOTE: * half of the "activities" were easy to calculate since they have a "timestart" and "timeend" columns but i can not figure out how to solve the ones that do not have a "timestart" column.

SUM of last 24 hour scores within a specific range in a sorted set (Redis)

Is there a way to calculate the SUM of scores saved under 24 hour respecting performance of the Redis server ? (For around 1Million new rows added per day)
What is the right format to use in order to store timestamp and score of users using sorted sets ?
Actually I am using this command:
ZADD allscores 1570658561 20
As score, it is the actual time in seconds ... and other field is the real score.
But, there is a problem here ! When another user get the same score (20), it is not added since it's already present - Any solution for this problem ?
I am thinking to use a LUA script, but there is 2 headaches:
The LUA script will block other commands from working until it is finished the job (Which is not a good practice for my case since the script have to work 24/24 7/7 meanwhile many users have to fetch datas in the same time from the Redis cache server like users scores, history infos ect.) - Plus, the LUA script have to deal each time with many records saved each day inside a specific key - So, while the Lua script is working, users can't fetch datas ... knowing that the Lua script will work in loop all time.
Second, it is related to the first problem that do not let me store same score if I use timestamp as score in the command so I can return 24 hour datas.
If you are in my case, how will you deal with this ? Thanks
Considering that the data is needed for last 24 hours(Sliding window) and the number of rows possible is 1 million. We cannot use sorted set data structure to compute sum with high performance.
High performance design and also solving your duplicate score issue:
Instead with a little decision on the accuracy, you can have a highly performant system by crunching the data within a window.
Sample Input data:
input 1: user 1 wants to add time: 11:10:01 score: 20
input 2: user 2 wants to add time: 11:11:02 score: 20
input 3: user 1 wants to add time: 11:17:04 score: 50
You can have 1 minute, 5 minutes or 1 hour accuracy and decide window based on that.
If you accept an approximation of 1 hour data, you can have this while insertion,
for input 1 :
INCRBY SCORES_11_hour 20
for input 2:
INCRBY SCORES_11_hour 20
for input 3:
INCRBY SCORES_11_hour 20
To get the data for last 24 hours, you need to sum up only 24 hourly keys.
MGET SCORES_previous_day_12_hour SCORES_previous_day_13_hour SCORES_previous_day_14_hour .... SCORES_current_day_10_hour SCORES_current_day_11_hour
If you accept an approximation of 5 minutes, you can have this while insertion, along with incrementing the hourly keys, you need to store the 5 minute window data.
for input 1 :
INCRBY SCORES_11_hour 20
INCRBY SCORES_11_hour_00_minutes 20
for input 2:
INCRBY SCORES_11_hour 20
INCRBY SCORES_11_hour_00_minutes 20
for input 3:
INCRBY SCORES_11_hour 20
INCRBY SCORES_11_hour_05_minutes 20
To get the data for last 24 hours, you need to sum up only 23 hour keys(whole hours data) + 12 five minute window keys
If the time added is based on the current time, you can optimize it further. (Assuming that if it is 11th hour and the data for 10th, 9th and the previous hours wont change at all).
As you told it is going to be 24/7, we can use some computed values from the previous iterations too.
Say it is computed on 11th hour, you would've got the values for past 24 hours.
If it is again computed on 12th hour, you can reuse the sum for 22 intermediate hours whose data is unchanged and get only the missing 2 hours data from redis.
Similarly further optimisations can be applied based on your need.

Excel complicated formula for a user form

Some of my colleagues attend conferences, meetings and workshops in various cities.
An example of a made up itinerary is shown below
The itinerary includes stopovers and each location is marked by a trip number. (A:15 to A:22)
I am working on a user form which would give me the time spent in hours and minutes from the departure to the arrival time for each trip number. Note that some trips include a stopover which is why there are three trip number entries for number 1 (trip to Frankfurt via Paris)
I know that the overall time spent for all these trips is 185 hours and 45 minutes as stated in L:23.
In red, along raw 23 there are five formulas as follows:
C:23 shows 24/06/2016 which is =C17
D:23 shows 19:15 which is =D17
H:23 shows 16/01/2016 which is =LOOKUP(2,1/(H17:H22<>""),H17:H22) it picks up the last date inserted between H17:H22
J:23 shows 13:00 which is =LOOKUP(2,1/(J17:J22<>""),J17:J22) it picks up the last time value inserted between J17:J22
L:23 shows 185:45 hours and minutes. It is the difference between the departure date and time of the first and the arrival date and time of the last trip. (Overall time in hours and minutes) =MAX(0,(H23+J23)-(C23+D23))
I need a way to work out the total time of 185:45 broken down between various business trip numbers in C:26 to C:29. Note that trips will always be shown in a logical order i.e. 1,2,3 but the amount of legs per trip will vary depending on stop overs. The minimum amount of trips is 1 and the maximum amount of trips is 4.
Thanking you in advance
Abe
Try this:
=TEXT(MAX(IF($A$17:$A$22=A26,$I$17:$I$22+$J$17:$J$22))-MIN(IF($A$17:$A$22=A26,$C$17:$C$22+$D$17:$D$22)),"[hh]:mm")
It is an array formula and must be confirmed with Ctrl-Shift-Enter. Put in C26, hit Ctrl-Shift-Enter then copy down.
Edit: As per OP's comments, what was wanted was the total of time from beginning of leg to the beginning of the next leg. So the formula was changed to:
=IF(MIN(IF($A$17:$A$22=A26+1,$C$17:$C$22+$D$17:$D$22))=0,MAX(IF($A$17:$A$22=A26,$I$17:$I$22+$J$17:$J$22)),MIN(IF($A$17:$A$22=A26+1,$C$17:$C$22+$D$17:$D$22)))-MIN(IF($A$17:$A$22=A26,$C$17:$C$22+$D$17:$D$22))
This is still an array formula. It needs to be confirmed by hitting Ctrl-Shift-Enter. Then copied down.

In Crystal Report print only first record in group and leave it summable

I have a table that lists every task an operator completed during a day. This is gathered by a Shop Floor Control program. There is also a column that has the total hours worked that day, this field comes from their time punches. The table looks something like this:
Operator 1 Bestupid 0.5 8 5/12/1986
Operator 1 BeProductive 0.1 8 5/12/1986
Operator 1 Bestupidagain 3.2 8 5/12/1986
Operator 1 Belazy 0.7 8 5/13/1986
Operator 2 BetheBest 1.7 9.25 5/12/1986
I am trying to get an efficiency out of this by summing the process hours and comparing it to the hours worked. The problem is that when I do any kind of summary on the hours worked column it sums EVERY DETAIL LINE.
I have tried:
If Previous (groupingfield) = (groupingfield) Then
HoursWorked = 0
Else
HoursWorked = HoursWorked
I have tried a global three formula trick, but neither of the above leave me with a summable field, I get "A summary has been specified on a non-recurring field"
I currently use a global variable, reset in the group header, but not WhilePrintinganything. However it is missing some records and upon occasion I will get two hoursworked > 0 in the same group :(
Any ideas?
I just want to clarify, I have three groups:
Groups: Work Center --> Operator --> Date
I can summarize the process hours across any group and that's fine. However, the hours worked prints on every detail line even though it really should only print once per Date. Therefore when I summarize the Hours Worked for an operator the total is WAY off because it is adding up 8hours for each entry instead of 8 hours for each day.
Try grouping by the operators. Then create a running total for the process hours that sum for each record and reset on change of group. In the group footer you can display the running total and any other stats for that operator you care to.
Try another running total for the daily hours but pick maximum as the type of summary. Since all the records for the day will have the same hours work the maximum will be correct. Reset with the change of the date group and you should be good to go.