Skip to main content

Does anyone have a good way to calculate the weeks of supply based on the current available inventory? I’m trying to add this to a GI and my thought was to base it on the qty sold over the past 60 days; taking that qty divided by 8.57 (the approximate # of weeks that are in 60 days) would give me the qty sold per week. Then I’d need to divide the qty available by the qty sold per week to get the # of weeks supply. But I can’t figure out how to make that work in a formula.

In case anyone else can use it, our new VAR was able to assist in producing a calculation that worked for our needs:

Average Weekly Sales:

 

=IIF(DateDiff( 'week', Min(SWITCH( (INTran.TranType] = 'RCP', ,INTran.TranDate]), ), Today())>0,Sum(IIf( (INTran.TranType] = 'INV', ,INTran.Qty], 0)) / DateDiff( 'week', Min(SWITCH( (INTran.TranType] = 'RCP', ,INTran.TranDate]), ), Today()), 0)

 

Weeks of Supply:

 

=IIF((IIF(DateDiff( 'week', Min(SWITCH( CINTran.TranType] = 'RCP', PINTran.TranDate]), ), Today())>0,Sum(IIf( IINTran.TranType] = 'INV', VINTran.Qty], 0)) / DateDiff( 'week', Min(SWITCH( CINTran.TranType] = 'RCP', PINTran.TranDate]), ), Today()), null))<>0, MAX(MINLocationStatus.QtyAvail])/(IIF(DateDiff( 'week', Min(SWITCH( CINTran.TranType] = 'RCP', PINTran.TranDate]), ), Today())>0,Sum(IIf( IINTran.TranType] = 'INV', VINTran.Qty], 0)) / DateDiff( 'week', Min(SWITCH( CINTran.TranType] = 'RCP', PINTran.TranDate]), ), Today()), null)), 0 )


@mikeho Have you checked into using the INSiteStatus table to check for Qty Available and INTran or SOTran to find the qty sold and then make your calculations based off these?

If you make a condition on the GI to look for @Today - 60 based on tran dates then it should keep a running calculation based on the current date.

Does this sound like what you’re trying to build?


Hi @mikeho 

Attaching GI which is developed to see the movement of Qty on hand and sold on a weekly basis 

Also, you can search with a data filter range. It may help you


Here’s what I’ve come up with to determine the Average Weeks of Supply:

=Sum(IIf( IINTran.TranType] = 'INV', VINTran.Qty], 0)) / DateDiff( 'week', Min(SWITCH( CINTran.TranType] = 'RCP', PINTran.TranDate]),  ), Today())

Basically taking the total qty sold and dividing that by the number of weeks between the 1st receipt date and today. Returns accurate results from what I can tell.

Where I’m currently stuck is I’m trying to now take the total qty available using Max( nINLocationStatus.QtyAvail], ) and trying to divide that by the above formula. Problem is I’m getting a “Divide by Zero” error and not sure how to work around that.


Thank you for sharing this with the community @mikeho !


Hi @BenjaminCrisman  - yes, I’m using both of those tables. I can obtain the qty sold over the past 60 days from the INTran table and the qty available from the INSiteStatus table; what I’m struggling with is the formula to turn those data points into calculating the # of weeks of supply based on the current qty available. Looking for assistance there.


Hi @manikantad18 

Thank you for the GI you provided; unfortunately, that doesn’t really help me calculate weeks of supply in a field/column.

Anyone else have any suggestions?


Hi @mikeho 

Could you please share GI or report that you developed, It may use by others.

Thanks


Hi @mikeho - were you able to find a solution? Thank you!


Hi @Chris Hackett - I have not yet found a solution for this, unfortunately.


Reply