December 5, 2016
Hoping someone can help me with a solution to this problem. Sorry if this gets lengthy, I will do my best to explain.
I have a list of products that are in column A, along with a work order and operation to perform some work on that product in column B. The amount of time allowed for each Work Order & Operation is listed in column C.
Each product can have multiple work orders and multiple operations per work order, but each work order is specific to a product. In other words, the unique identifier would be the work order + the operation.
I am basically pulling a weekly clocking report against a list of products that lists all of the work orders and operations for those products and the time clocked each day against them and pivoting the data out similar to the picture. As time progresses, the data set will grow to include any new time clocked each day going all the way back to the date it was first started. I need help figuring out what formula(s) or other solution will allow me to do the below fairly painlessly each week.
What I want to be able to do is create a line chart that gives me the amount of time loaded that week for a product (The STD) vs the amount of time clocked against it. This will be a cumulative weekly line that sums up all the time available for all work orders and operations for a product vs the cumulative time expended over the same period.
The tricky part is I only want to sum the STD time up to the available limit. (If a work order + operation is allowed 8 hours, but 16 have been clocked against it, only show up to that 8 hours on whatever day(s) it was clocked. If 2 hours were expended each day for 4 days = 8 hour STD show that, but make any time after that show as 0.
Hopefully the picture will do a better job of explaining. The date axis will be in weekly buckets not days, but I thought it was easier for the explanation of what I want to do this way.
For Work Order + Operation 1567789 0010, 8 hours total is available. On 5/5 2 hours is clocked bringing the available down to 6 until the next day it is clocked and so on until all 8 hours have been expended. On 5/8, all 8 hours have been expended over previous days so I would want 0 hours on 5/8 and any future dates even if time was clocked on those days. That weeks line would show 8 hours available against 20 expended.
Appreciate any tips / solutions!
July 16, 2010
That's a tricky one because for every product you need 3 sets of data, two of which are plotted in the chart. It would be easy if it wasn't for the requirement to not plot time that exceeds the available limit. This requires a formula based approach, vs doing it all with PivotTables, which would enable you to automate it.
Perhaps you could use Power Pivot and write a custom DAX measure that calculates the actual hours up to the point where they exceed the available hours.
December 5, 2016
Thanks for the reply Mynda!
I was wondering if I could pivot it out every week and then basically add a calculation row to the right of the data set for every row. Basically the dates would all be duplicated for each row. I'd use this calculation row for my chart line.
Possibly use offset or something to calculate the sum of the clocking transactions against the fixed STD and if it was less, give that day whatever was clocked. If more, just give the last date the difference of the sum vs the STD and all future dates 0.
Just wasn't sure how to pull it off because the date range will be growing dynamically.
Thanks for the ideas. I'll keep trying.
July 16, 2010
You could certainly enter the formulas in columns that are currently empty in anticipation of growth in your data. Have the formula return #N/A if there isn't any data for that month. #N/A doesn't get plotted in a chart, so it will give you the desired result. Just fiddly having to create all those formulas. Not ideal!