Skip to main content

Has anyone ever added the overall average to the footer of this report? I’ve tinkered with it but haven’t gotten it to work and was hoping someone else has already accomplished this and could share their report version. Thanks!

Hi @hayleehicks18! It doesn’t look like the image or what you are linking is showing up, can you try again?


Hi @BenjaminCrisman! I didn’t include a link. The standard report is AM653000, and I haven’t gotten far enough with it to have anything to share. I was hoping someone has added an overall average to the footer and could share how they were able to do it.

Here’s a screenshot of the report from the demo system. I am looking to grab the averages from each section and then put an overall average at the end of the report.

 


Hi @hayleehicks18! This is a little tricky because one part of the variable’s expression calculating the average can result in a 0 on a the denominator, causing the NaN to show.

For me I broke out the expression for Total Efficiency into three lines:

 

So the result is 1/0, which can’t happen obviously.

So to get around this you’ll need to adjust this expression so it will never return a 0, then the NaN will stop coming in.

After that you can add the Report Footer section and create a new variable $TotalAverage like:

=$TotalAverage+( $TotalEfficiency/$TotalOperations):

Then display it in the Report Footer:

This should keep a running total now of the averages, as long as none of them are NaN.

Next you’ll need to add another variable to the header where the Production Order shows:

This way you have a count of how many production orders are in the report, then you can divide the $TotalAverage variable by the $Line variable to get the average for all the showing orders:

This is how I did it, but the MFG module isn’t really my expertise, so I don’t know the best expression to stop the denominator from appearing as 0 (I just replaced it with 1 in my tests).

Let me know if this helps


Hi @BenjaminCrisman! Thanks for the info! That is very helpful. Do you mind dropping the rpx file, so I can take a look and follow along with what was updated on it?


I’ve attached it, it’s not complete, but it’s close I think


This is as close as I could get it. It mostly works for what we’re needing! Still the occasional null value. Attaching here for others to use if interested.


Reply