# Process Capacity setup

Airtable Masters,

I have set up related tables with rollups and lookups in the past, but this problem has me stumped. I am trying to determine a process capacity by looking at each order and determining the number of units due between the current time and the due date of the order. I have read several post where similar questions are asked, but no answers given. Is this even possible with Airtable?

Thanks in advance for any ideas!

Hi @Josh_Cooper,

The formula for determining the duration between the current time and the due date of the order would be `DateTime_Diff(NOW(), {Due Date}, 'hours')`

BR,
Mo

@Mohamed_Swellam The issue here isnâ€™t one of pure date difference. The way I read it, @Josh_Cooper is trying to determine whether or not an order can be filled based on a combination of time and a certain production rate. In other words, with an order of X units, due in Y days, and given that only Z units can be made per day, can the full order be completed by the deadline. Is that correct?

If so, I suggest adding a field to your `[Items]` table that is named something like `{Max Per Day}`, and which records the highest number of that item that can be made in a single day.

In the order table, Iâ€™m assuming thereâ€™s a link to the item, which you can use to roll up that `{Max Per Day}` value for the item, using `SUM(values)` to bring it in as a number. If your main order table contains one item per order record, Iâ€™m guessing that youâ€™ll also have the item quantity and due date in that same record. If thatâ€™s the case, then this formula will let you know if the itemâ€™s production capacity has been exceeded or not:

``IF(Quantity / DATETIME_DIFF(Deadline, NOW(), "days") > {Max Per Day}, "âťŚ", "âś…")``
1 Like

Thanks Justin and Mohamed for the quick replies!

Justin has the right Idea. I will have to do some table restructuring, which I was honestly trying to avoid, but I think that will work.

Thanks for the help!!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.