[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Adding a Totals Field to a Report (ViP Specific) ==== === At 04 JUN 1998 03:47:20AM Jason wrote: === {{tag>"ViP Specific"}} Okay so I've finally got the report almost laid out like I need it. Now the only thing I need to do is to add Totals to the Report (preferably arranged in the Group Band right above the detail band). I have a field called Units which I need to total (count) and then I have some sales price field I need to sum and some percent fields I need to Average. When I add the field to the Group band it just equals the last document in the Group no matter what I do. What am I missing? ---- === At 04 JUN 1998 03:30PM Stephen Bellefontaine Revelation wrote: === Hello Jason, It sounds like there is something wrong with then calculated field... You can use aggregate functions (such as sum, average, and count) in calculated fields to perform computations using the data in all rows in a group, or all the rows in a report. You can include aggregate functions in calculated fields in a group header or footer, or the report header or footer. The band where you create the calculated field determines the scope of the aggregate calculation. For example, if you use the Sum function in a report footer, ViP totals all the rows in the report; if you use the Sum function in a group footer, ViP totals all the rows in each group. You can also use aggregate functions in calculated fields to produce a summary report, which turns off printing of some or all detail band rows and prints only the results of the calculations. For example, you can create a summary report that contains only the summary sales for each group and for the entire report. To calculate a group subtotal: ·. Select the header or footer of the group you want to subtotal, choose Field from the Create menu, and, in the Create Field dialog box, enter a formula to use for the subtotal in the Formula text box. For example, to print the salaries for all employees in a department: Sum(Salary). (Alternative Procedures) To calculate a subtotal for each row: · Select the detail band, choose Field from the Create menu, and, in the Create Field dialog box, enter a formula to use for the subtotals in the Formula text box. For example, to calculate total compensation per employee and print the values in the new column: Salary + Bonus + Benefits. (Alternative Procedures) To calculate a grand total: · Select the report footer, choose Field from the Create menu, and, in the Create Field dialog box, enter a formula to use for the grand total in the Formula text box. For example, to print the total salary for all employees in a company: Sum(Salary). (Alternative Procedures) To calculate a running total: · Select any band (except the page header or page footer), choose Field from the Create menu, and, in the Create Field dialog box, select Running Total and enter a formula to use for the running total in the Formula text box. Hope this helps, ViPDX Tech Support [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=59740D8B2C7AA53E85256619002AC959|View this thread on the forum...]]