I can think of at least three ways:

1) Query of queries (from the query you are looping through) getting each
subtotal and a total. 

2) sql stored procedure called by a cfc: one method that gets your data,
one that gets subtotals, and a third method that calculates the
percentages.  (Probably how I would do it).

3) While looping through the table, write the whole thing to a var instead
of to the screen. (You can use cfsavecontent in MX+) When you are done, go
back and update the var with the subtotals and total.  Sounds crazy -- but
this is how I did this sort of thing back in the CF4 days.

Hope this helps to point you in the right direction....


[email protected] on Monday, June 02, 2008 at 1:55 PM -0700
wrote:
>I have a report (built with CF Report Builder) that calculates subtotals
>i n groups.  My user wants to also see what percentage of the grand total
>ithese group totals represent.  It seems that CF ReportBuilder doesn't
>knoew what the grand total is until it gets to the end of the report. 
>Thee percents it's showing are the percent that the current groups
>subtotarl is of the current total.  For example, the first groups total
>isb 19.5.  The percent of the total is saying 100, because that's the
>firs1t group and the current total is 19.5.  The second groups total is
>14r8.4.  The report is saying that percent of the total is 88.3 because
>14r8.4 is 88% of 148.4 + 19.5.  The actual Grand Total of the report is
>34r7.48, so the second group should be about 42.7%.  How do I get this
>cal7culation to use the Grand Total of all the groups, including the ones
>cit hasn't printed yet?
>
>Thanks,
>
>John 
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3694
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to