Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inventory Supply 1

Status
Not open for further replies.

dinzana

Programmer
Nov 21, 2002
118
US
Any ideas on how can I use MSTR to calculate the number of weeks i had inventory supply for.

Week 1, I had 100 units on hand, I sold 50 of those units and did not recieve any from the factory,
Week 2, I had 50 units on hand, I sold 25 of those units and did not recieve any from the factory,
Week 3, I had 25 units on hand, I sold 25 of those units and recieved 100 new units from the factory,
Week 4, I had 100 units on hand, I sold 25 of those units and did not recieve any from the factory,
Week 5, I had 75 units on hand, I sold 0 those units and recieved 25 new units from the factory.

WEEK ONHAND UNITS_SOLD UNITS_RECD
=========================================================================================================
1 100 50 0
2 50 25 0
3 25 25 100
4 100 25 0
5 100 0 25

What I want to do is:

Count the number of weeks that the sum(units_sold) is less than or equal to the onhand for a given week.

In other words, for Week 1, I had 100 units on hand, and the sum(units_sold) for Week 1, 2 and 3 addup to 100 so, 3 three weeks of supply is what I had for Week 1.

Any ideas?

Thanks in advance.

-dinzana
 
Dan, this is rather easy to write a function to calculate this, and then just create a metric calling this function for a given week.
 
Thanks Z3,

I will give that a shot, sounds like a great idea.

-dinzana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top