Sum a memo from Group Detail Footer in the Footer
I am trying to Sum a Memo value from the group detail footer in the Footer but I keep getting a repeat value of the memo based on the number of line items in the following group
eg
Lets say there is groups A,B,C
Group Footer
Memo1 = [Memo2.Value - Memo3.Value] , This works as predicted Lets say result = 5 ( I Also have a IIF group = in memo 1 also so this value does not show in all groups )
Footer
Memo4 = [SUM( Memo1.Value )] , This would Give 5 ( From Memo1 ) * the number of line items in the next group. eg if there were 10 item in the following group would return 50 rather than the 5 that I am looking for
I have also tried the Options in SUM of DataDetail1, 1,2 & 3
I need to do it this way because if one of the groups has an option set then the Group total is re-calulated and I need to reflect that in the total value so I cant use the DB values
This is the actual value of the Memo1 in the above example ( Memo9 is the new calculated value )
[Memo9.Value - SUM(<frdPrintGroup."LineTotal">,DetailData1)] this give the desired result
eg
Lets say there is groups A,B,C
Group Footer
Memo1 = [Memo2.Value - Memo3.Value] , This works as predicted Lets say result = 5 ( I Also have a IIF group = in memo 1 also so this value does not show in all groups )
Footer
Memo4 = [SUM( Memo1.Value )] , This would Give 5 ( From Memo1 ) * the number of line items in the next group. eg if there were 10 item in the following group would return 50 rather than the 5 that I am looking for
I have also tried the Options in SUM of DataDetail1, 1,2 & 3
I need to do it this way because if one of the groups has an option set then the Group total is re-calulated and I need to reflect that in the total value so I cant use the DB values
This is the actual value of the Memo1 in the above example ( Memo9 is the new calculated value )
[Memo9.Value - SUM(<frdPrintGroup."LineTotal">,DetailData1)] this give the desired result
Comments
1 top down depending on band type.
2 left to right in order of creation within the band.
3 the value method of a memo only returns the value of the last expression in the memo.
"Memo1 = [Memo2.Value - Memo3.Value] ," this would produce an error value
as memo1 is processed before memo2 or memo3
On the DetailData1 Band I have GroupFooter1 which contains the following
Memo9 with either the db/calculated total depending on the group - This gives the desired result
Memo50 which calculates the difference between the db and calculated totals - This also gives the desired result
On Footer1
Memo55 which I want to have the sum of Memo50 - This does not, Memo50s value is multiplied by the number of items in the next group eg if total was 5 for group A and then there were 6 items in group B it would multiply the answer eg 5 x 6 = 30 , if there were 8 items in group B it would be 5 x 8 = 40 rather than the correct sum in this example of 5
what db engine are you using and what version of fr4