# Summing Previous and Current Weeks Open Orders

Options

Hello,

I am looking to write a formula to incorporate orders that were placed in previous weeks but are left out of current week. In the example pictures, the current week has 312 units open, but the current open from previous weeks and current week is at 10,056 units. The residual is not included in my module is throwing off my ordering calculation. Is it possible to write a formula to incorporate all current open orders from current and prior weeks?

• Options

Hi! If I understand this correctly here what you want to do:

Step 1: Create a Cumulative Line Item
CUMULATE(Orders Open, TRUE, Time.All Periods)

Step 2: Adjust the Formula for Current and Previous Weeks
IF ITEM(Time) < 'Current Week' THEN PREVIOUS(Orders Open) ELSE 0

Step 3: Integrate the Cumulative Open Orders into Your Ordering Calculation
'New Orders Required' = 'Target Inventory Level' - 'Inventory on Hand' - 'Cumulative Open Orders'

Let me know if this helps!
Thanks!