AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Fill Rate by Item
 
Notifications
Clear all

Questions Fill Rate by Item

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Tim Rodman 8 years ago
6 Posts
4 Users
0 Reactions
4,964 Views
RSS
Posts: 58
 sunwayfan
Topic starter
May 8, 2018 3:50 pm
(@sunwayfan)
Member
Joined: 9 years ago

I have created a GI that gives the Fill Rate % by Item, But it runs very slow when I try to change the Date parameters. 

Also It gives a Divide by zero error when I try to export the GI

Even when I try to filter the Backorders column it gives the divide by zero error

Right-click to Download


5 Replies
Shawn P Slavin
Posts: 196
 Shawn P Slavin
May 8, 2018 4:10 pm
(@shawn-p-slavin)
Estimable Member
Joined: 6 years ago

I think the issue as to do with the value of your calculation's denominator .  If it is 0 or Null, you are dividing by zero and therefore produce an error. You need to ensure the value is neither 0 nor null first. I modified you formula to put your calculation into an IIF statement and added an IsNull verification as well. If the ShippedQty is null, the IsNull function will convert it to a 0. If it is not null, it will return the value in the field. Then we check the adjusted value to see if it equals 0. If so, we skip the calculation and just return a 0. If not, we perform your calculation.

=IF(isnull([SOLine.ShippedQty],0)=0,0,(((sum([SOLine.ShippedQty])) - sum([SOLine.OpenQty]))/ (sum([SOLine.ShippedQty]))) *100)

Please let me know if this works.


Reply
Posts: 58
 sunwayfan
Topic starter
May 9, 2018 1:07 am
(@sunwayfan)
Member
Joined: 9 years ago

I tried this but getting the following error

https://timrodman.s3.us-east-2.amazonaws.com/forums/255-ItemQtySOQty.xml

 

Column 'SOLine.ShippedQty' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause


Reply
Shawn P Slavin
Posts: 196
 Shawn P Slavin
May 9, 2018 4:49 pm
(@shawn-p-slavin)
Estimable Member
Joined: 6 years ago

Looking at your GI, you are using sum functions within your calculation of the fill rate. Acumatica doesn't like aggregate functions within an aggregated result.

The line calculation should look like this.

=iif( [SOLine.ShippedQty]=0,0,(([SOLine.ShippedQty] - [SOLine.OpenQty])/ [SOLine.ShippedQty] *100))

I took the IsNull function out as the default value for the field is 0 and therefore you should always have a non-null value.

The IIF returns a 0 for the fill rate if the quantity shipped is 0. Otherwise, it calculates the line fill rate.

Since the entire GI is within a Group By clause, we aggregate each column returned (is visible) that is not in the grouping clause. For the quantities, use Sum. For the Order ID, use Count. For the fill rate, use Average.

Hope this helps.


Reply
VJW
Posts: 51
 VJW
May 25, 2018 1:41 am
(@vjw)
Trusted Member
Joined: 6 years ago

@Shawn

Wow, I impressed by your knowledge! Thanks for contributing, you examples and explanations really helps in understand the system and inquiries


Reply
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
June 4, 2018 1:52 pm
(@timrodman)
Famed Member
Joined: 11 years ago

Awesome @shawn-slavin. Love it!


Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,532 Topics
  • 11 K Posts
  • 23 Online
  • 2,420 Members
Our newest member: Katerina Pawlowski
Latest Post: Can't export GI's to excel that contain the FATrans DAC after upgrade to 2025 R1 in less than 25 min
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×