Skip to main content
Solved

GI Expressions with Grouping Applied


Forum|alt.badge.img

Hi All,

I have a GI where I am pulling the total quantity required for Materials in multiple production orders.

The GI is grouped by AMProdMatl.InventoryID and the TotalQtyRequired has the aggregated function: SUM.

 

Then I have the INSiteStatus.QtyOnHand which I have the aggregated function: AVG so that I see the actual On hand quantity and it does not technically get grouped.

 

What I would also like to have is an expression of 

=IIf( ([INSiteStatus.QtyOnHand] - [AMProdMatl.TotalQtyRequired])<0, [INSiteStatus.QtyOnHand] - [AMProdMatl.TotalQtyRequired], null)

 

Meaning if we are short QOH for what is totally required, it will show the difference. Or else its blank.

 

For some reason I cannot get this Expression to display correctly. I am assuming it is because of the Grouping and maybe aggregated functions.

 

Is there some way I need to do something to choose the aggregated function like this:

=(AVG[INSiteStatus.QtyOnHand]) - (SUM[AMProdMatl.TotalQtyRequired])   ?

 

I have attached my GI, a lot of items that should show short, do not, and even the ones that do show, the quantity is not correct. 

 

 

Can someone see if there is something wrong with my formula?

Best answer by bodiec

Terribly sorry, I figured it out. 

 

I had the sum and avg portions of my expression incorrectly set up. I needed to move the ().

=(AVG([INSiteStatus.QtyOnHand])) - (SUM([AMProdMatl.TotalQtyRequired]))

 

Here is the formula I ended up with. 

=IIf( (AVG([INSiteStatus.QtyOnHand])) - (SUM([AMProdMatl.TotalQtyRequired]))<0, (AVG([INSiteStatus.QtyOnHand])) - (SUM([AMProdMatl.TotalQtyRequired])), null)

 

Thanks Anyways

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

2 replies

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 33 replies
  • Answer
  • April 14, 2025

Terribly sorry, I figured it out. 

 

I had the sum and avg portions of my expression incorrectly set up. I needed to move the ().

=(AVG([INSiteStatus.QtyOnHand])) - (SUM([AMProdMatl.TotalQtyRequired]))

 

Here is the formula I ended up with. 

=IIf( (AVG([INSiteStatus.QtyOnHand])) - (SUM([AMProdMatl.TotalQtyRequired]))<0, (AVG([INSiteStatus.QtyOnHand])) - (SUM([AMProdMatl.TotalQtyRequired])), null)

 

Thanks Anyways


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2789 replies
  • April 14, 2025

Thank you for sharing your solution with the community ​@bodiec!


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