Skip to main content
Solved

How to calculate weeks of supply


Forum|alt.badge.img

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.

Best answer by mikeho

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( [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()), null))<>0, MAX([INLocationStatus.QtyAvail])/(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()), null)), 0 )

View original
Did this topic help you find an answer to your question?

10 replies

BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 691 replies
  • September 8, 2022

@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?


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 228 replies
  • September 8, 2022

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.


Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+13

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


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 228 replies
  • September 8, 2022

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?


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 228 replies
  • September 12, 2022

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

=Sum(IIf( [INTran.TranType] = 'INV', [INTran.Qty], 0)) / DateDiff( 'week', Min(SWITCH( [INTran.TranType] = 'RCP', [INTran.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( [INLocationStatus.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.


Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+13

Hi @mikeho 

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

Thanks


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2749 replies
  • November 1, 2022

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


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 228 replies
  • November 2, 2022

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


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 228 replies
  • Answer
  • November 29, 2022

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( [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()), null))<>0, MAX([INLocationStatus.QtyAvail])/(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()), null)), 0 )


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2749 replies
  • November 29, 2022

Thank you for sharing this with the community @mikeho !


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings