Skip to main content

Group,

I have an inquiry that I’m working on and struggling with the formula.  I either get the “divide by zero error encountered” message, or syntax error.  

 

I need to take this formula already set in the inquiry, (this gives us our Average Inventory)

 =(

and divide it by: (This gives us the Sales COGS)

=(GINItemCostHist.FinPtdQtySales] + QINItemCostHist.TranPtdQtyAMAssemblyOut]) * mINItemCost.AvgCost]

 

This final number that I am attempting to find is the inventory Turns for my Supply Chain manager. He can achieve this in excel, but I wanted to try and give this to him in the report.

 

I have tried many different ways to write it and sometimes it says it validates, other tries it doesn’t.  I did find another post on in the community that talked about the divide by zero error and tried different ways of writing the code similar to that result but haven’t gotten it to work.

Does Acumatica allow this type of formula in a GI?

Thank you for any pointers.

Trisha

 @tveld It seems like the 0 value results are throwing off the case, are they necessary to include?

If not then I would recommend setting a filter condition to make sure that field only returns results > 0

If they are still needed then the recommendation would be to include an if statement as part of the function to check for 0 values and then make an adjustment to the expression based off that.


@BenjaminCrisman ,

Thank you, I did check with the manager, and he wants to keep those zero items in the report.  To keep that in there, what is the best way to show the formula?  I’ve tried multiple ways and haven’t been able to find the right combination.

Thank you!


This is the way I have the formula currently written.  It comes back with the error “outside the bounds of array”.

=iif(=INItemCostHist.FinBegCost]+oINItemCostHist.FinYtdCost])/2 / IIF( (IINItemCostHist.FinPtdQtySales] + sINItemCostHist.TranPtdQtyAMAssemblyOut]) * ]INItemCost.AvgCost], 0 ) 

Thank you


I was able to find my correct formula.  Thanks for the help!


Reply