Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item stock levels panel calculations are wrong... #119

Open
Gwalior-84 opened this issue Jul 9, 2020 · 6 comments
Open

Item stock levels panel calculations are wrong... #119

Gwalior-84 opened this issue Jul 9, 2020 · 6 comments

Comments

@Gwalior-84
Copy link
Collaborator

https://png.msupply.org:3000/d/9gnQQXMMk/item-stock-levels-morobe

Calculation of MOS from SoH and AMC is clearly wrong in a number of instances.

image

@Gwalior-84
Copy link
Collaborator Author

Gwalior-84 commented Jul 15, 2020

@anildahalsussol has explained to me that part of the problem is that AMC here is

normal AMC where it Calculates 'AMC' values for each distinct (item, store), where the value is the average of monthlyConsumption values in aggregator table. Months without values in the aggregator table are not included in calculation.

I can see that this would result in higher AMC values than if months without values were included, and so the MOS figures appear to be lower than what they should be.

That still doesn't explain how the MOS calculation is generated. In any case, it certainly looks wrong here and needs to be fixed.

Where does the MOS figure come from, if it isn't coming from SOH / 'Normal' AMC?

@andreievg
Copy link

@Gwalior-84

We definitely should have more docs regarding how AMC is calculated.

where the value is the average of monthlyConsumption values in aggregator table. Months without values in the aggregator table are not included in calculation.

There is an option enforceLookBackPeriod on AMC calculation in aggregator that is 'true' by default (originally this option was missing and look back period wasn't enforce, and the months with zero consumption were not included in AMC calculation)

There is some explanation regarding AMC calculation in this issue: #108

Maybe currentMOS data element should be used (panel might be using historic mos ?), there was this issue I've made a while ago: #25

@aquimaia
Copy link

Hi Team,

how to calculate AMC in mSupply mobile ( what the formula)

@mark-prins
Copy link
Contributor

Hi @aquimaia - for this one, the AMC is essentially sum(consumption) / number_of_months. there are some differences in the number of months used to calculate, mostly though it isn't more complicated than that.

@aquimaia
Copy link

In grafana we can show, item, stock on hand, stock AMC, stock will request base on AMC in one table?

@mark-prins
Copy link
Contributor

yes, should be able to. Someone on the mSupply team would have to write a query for that but the data is available yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants