Hi, I apologise if this has been asked before or if it is a stupid question.
I work for a manufacturing company and I'm building a form which needs to be filled out by the production crew each shift (two shifts per day) and from it our quality team want to be able to see information in a summary report of the average damaged product etc.. per product per day.
What I have set up so far is a form with 3 views, view one gets filled in by Shift 1 and view 2 gets filled in by Shift 2 - These views are identical but with seperate fields so that there is no issues with fields being bound together.
The third view is the summary page for the quality team, on this view I have tables set up which pull information out of the other two views to show what products where produced each shift & I have formulas set up to calculate the averages of things such as damaged stock etc... for each individual product.
This all works fine, where I'm running into difficulty is I need to allow for the instance where the same product might be produced in Shift 1 and Shift 2. In this instance I need to be able to set up a formula to calculate the average of damaged stock etc... across both shifts.
I have set up some tables on the summary page to display this information and I have set up rules on the relevant fields in view 2 which set the values of the fields on the summary page (view 3) if there are two instances of the same product produced.
The fields in view 1 and view 2 where the data is entered are repeating tables to allow for several rows of data to be entered on each product (and each product is entered in a new table).
To calculate the averages of two occurances of the one product I set up the formula: (Sum(Field1) + Sum(Field2)) / (Count(field1) + Count(field2))
This formula works perfectly if there is only one row of data in each repeating table however if I add another row to either table the result is recalculated and it only seems to use the newest value entered.
So for example if a field in table A has a value of 20 and a field in Table B has a value of 10, on the summary page the average is calculating correctly to 15. But if I go back and add another row to table B and put in a value of 7 the average on the summary page changes to 13.5 which is incorrect as it should be 12.33 (20+10+7 = 37 / 3 =12.33).
What it seems to be doing is recalculating once I enter the 7 and ignoring the 10 that is already there and adding up 20+7 = 27 / 2 =13.5
I tried to work around the issue by adding a footer column to both repeating tables with totals fields which sum each of the required columns and display their total value.
I also added a field to count the number of entries. Both of these fields work perfectly - as I add new lines the count field increases by 1 each time and the totals fields update to reflect any new data entered.
So I then re-wrote my formula using these fields instead but for some reason, even though these fields contain the correct information, and are the total of all values in each particular column, the average shown on the summary page still only calculates on whatever the last value entered into the table is!
I have been over and over my formula and I can't work out why it is doing this.
Has anyone ever come across this before? Any help would be much appreciated as I am completely stumped by this.
Thanks in advance.