All Collections
Moving Average Cost (MAC) improvement
Moving Average Cost (MAC) improvement

Read how we improved MAC to give a more accurate look at the Average Cost

Dayvid Lorbiecke avatar
Written by Dayvid Lorbiecke
Updated over a week ago


  • The system will recalculate all stock movements from the beginning of 2022 so the current moving average costs for variants can become different. Data before January 1st, 2022 will not be recalculated.

  • Moving average cost for each item will be saved in Katana as of December 31st, 2021.

MAC improvement

The update to MAC is an improved cost calculation algorithm in Katana which affects transactions starting from January 1st, 2022 to the present day. To avoid unwanted changes to older data, transactions prior to January 1st, 2022 will not be recalculated.

Katana saves the MAC for each variant as of December 31st and uses it as the starting point for all cost calculations moving forward.

How we improved cost calculation

Katana's cost calculation has been improved so that any update to stock that affects moving average cost is taken into account on all related documents as well. This means that all stock movement changes will trigger a recalculation of transactions made after the change. If the changed variant's moving average cost is used as an input for any other variant, then those transactions will also be recalculated to match all the changes in the system.

Changes made can be several things such as new documents added (sales, purchase and manufacturing orders, stock adjustments, and transfers), changes to existing documents (updated date, quantities, unit prices, locations), or data being deleted (entire documents or just inventory rows).

For example, if a purchase order of material is added to the system after a Manufacturing Order used it as an ingredient, the cost of the manufactured product is recalculated to account for the changes in material cost. Also, if the product is already sold before this update of material cost, the cost of goods sold for the sales order is also recalculated since the cost of one of the products on it has changed.

Switching to MAC 2.0

All transactions that affect stock levels and their moving average cost are visible in the inventory intel.

The Inventory intel lists all of the stock movements for one variant. It can be opened by clicking on one of the visible balances (average cost, stock balance, etc) or from the stock balance fields on different documents by clicking the i-icon.

Katana will generate a new row as of January 1st for all variants in all the locations. The newly generated row is to save the moving average cost prior to the change.

The System generated row will contain the variant's stock balance, value in stock, and moving average cost. This moving average cost will be the starting balance for the new cost calculation.

Why can't I see the average cost before January 1st?

The improved cost calculation will be effective on all the data starting from January 1st. Katana uses December 31st average cost as the starting balance for all new calculations to avoid any unwanted recalculation to existing user data. Transaction rows before the System generated row are not included in the recalculation with the improved cost calculation.

What if you want to adjust the moving average cost?

Stock adjustment can be used to update the moving average cost (it is not possible to edit items prior to 2022). There are two ways to do that:

  • Manually create a stock adjustment with two rows for the variant which needs a changed average cost. The first row should have a negative quantity number to adjust the variant's balance to zero. After that, a second row is needed with a positive quantity in the Adjustment +/- field and the new average cost to Cost per unit field. The result will give you a stock balance of zero and then the same quantity brought back to stock with the new unit price.

  • Adjust stock levels with Update stock levels and stock values import. This import is available on the Data Import page under Settings. Update the value in stock field in the exported file according to the new unit price and when uploading the fail back to Katana choose Recalculate Moving Average Cost in Katana for any increase in stock from the uploaded file in the import model. The stock adjustment created from the import will have two rows for each variant for which the cost was changed. The first one is to adjust the stock level to 0 and then another with stock levels as they were previously including the value of stock with the average cost you want.

Inventory period closing

To avoid unwanted recalculation triggered by making changes to previous periods, the inventory period closing feature will be released together with moving average cost calculation improvements.

Did this answer your question?