Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totaling a Formula in a Group Footer 1

Status
Not open for further replies.

Milin

Technical User
Jan 5, 2000
33
US
Hello, <br>I am using Crystal5 and was told that it is not possible to total off of a number in a group footer- is that really true?...this is my situation:<br><br>I work in the travel and tourism industry and have a report that tracks meetings booked in my town and the hotel - or hotels - that they booked at, and each hotel's &quot;economic impact&quot; value on our city for that meeting.&nbsp;&nbsp;Because of the main database program that I am using CR on, I cannot get a total of this economic impact in the details section - I have to use the Max function and put the value in the group footer (grouped by meeting and hotel). What's more, when I have two hotels booked for one meeting, I have created a formula to split the economic impact value between the multiple hotels - again, this value must reside in the group footer.<br>so...my question is... since CR will not let me grand total the economic impact total off a value in a group footer, is there still a way to do this?? Is there a way to assign some sort of variable name to the group footer value and then grand total it for the whole report?&nbsp;&nbsp;It's very frustraiting - I had to stand on my head to make this report work, and in solving the problem of splitting out the economic impact, I can't do a simple grand total of it for the whole report!!<br><br>Thanks much, <br>Milin
 
I've used Running Totals to get subtotals and grand totals of group totals.&nbsp;&nbsp;I'm not sure if this is available in CR version 5, I've done mine in version 6.5.&nbsp;&nbsp;You need to reset your running total at the start of each group you are subtotaling to.&nbsp;&nbsp;One problem I encountered with this is that everytime you have the RT formula it adds that record, thus if you are doing a running total for Group 3 and displaying the summary in group 2, it will add the last record twice, once for the last time in group 3 and once for the time the RT is listed in the group 2 footer.&nbsp;&nbsp;To get around this, I created a formula to take the running total balance and subtract the field used in the running total.
 
Why not let CR do the work?&nbsp;&nbsp;Right click on the field to be totaled or select the field and use Insert Menu.&nbsp;&nbsp;Select 'Insert Subtotal' for the group total and 'Insert Grandtotal' for the end of report total.&nbsp;&nbsp;Does CR5 have this? <p>LindaC<br><a href=mailto:lcastner@co.orange.ny.us>lcastner@co.orange.ny.us</a><br><a href= > </a><br>
 
The reason I can't have CR do the work is how the tables are linked.&nbsp;&nbsp;We have receipts and adjustments, with at times multiple adjustments per receipt.&nbsp;&nbsp;We link these on the receipt number.&nbsp;&nbsp;The net weight is held on the receipt table, the adjusted costs or weights are held on the adjustments table.&nbsp;&nbsp;The problem is when it links it copies the net weight for every adjustment.&nbsp;&nbsp;I can create formula's to set the net weight to zero if the previous record's receipt number is the same as the current record, but I cant subtotal or grand total on that field because crystal returns an error &quot;The Summary Field can not be created.&quot;&nbsp;&nbsp;It would really make my day if I could get CR to total anything I can get into the detail record, but the only way I've found to do this is via running totals.
 
You cannot directly total a formula field in a group footer. What you can do is this:<br><br>1) In report header create a temporary variable (&quot;totalme&quot;) and set it equal to zero.<br><br>2) In group footer insert a formula: totalme:=totalme+@groupformulaname<br><br>3) In report footer display the value of totalme.<br><br>You will need the whileprintingrecords line in all 3 formulas.
 
I have a report in which I total a formula field in each group footer.&nbsp;&nbsp;I developed this report in CR6.5.&nbsp;&nbsp;It is for the county budget reports.&nbsp;&nbsp;I have a budget detail table which has a budget line number which links it to an accum detail table. There can be many accumes to budget line number.&nbsp;&nbsp;I set up the linking and selecting rows citeria in Crystal Query.&nbsp;&nbsp;I then feed the query into CR.&nbsp;&nbsp;In my detail I had to set up formulas to choose which column to put the dollar value of the accumulator depending on the accumulator number.&nbsp;&nbsp;I created formula fields for the accumes in the detail section saying:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if accume = 1 then dollarvalue else 0<br><br>I had to suppress the detail field because my report came out looking like:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accume1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accume2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accume3 <br>1000&nbsp;&nbsp;taxes&nbsp;&nbsp;&nbsp;&nbsp;200.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00 <br>1000&nbsp;&nbsp;taxes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00<br>1000&nbsp;&nbsp;taxes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;500.00 <br><br>I then did a summary of the first two fields and placed them in the group footer<br><br>I then put subtotals in the group footer letting CR do the work.&nbsp;&nbsp;Everything totals properly.&nbsp;&nbsp; <p>LindaC<br><a href=mailto:lcastner@co.orange.ny.us>lcastner@co.orange.ny.us</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top