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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Percentages 1

Status
Not open for further replies.

asrinath

Programmer
Apr 25, 2003
8
US
Hello All,

I have a report which is grouped by a database column. The report calculates a count() for some items in the <field>Group:After Frame and also a Grand Total in the Report:After Frame.

What I want to show with the report is a calculated percentage column of each <field> items over the Grand Total i.e if I get a total of 100 for a particular field and the Grand Total is 1000 then for that field I should show 10% and so on ? It seems Actuate calculates the Grand Total at the end and so I am always getting a 0 for the grandTotal variable that I have declared.

Can someone suggest an alternative ?

TIA

 
I believe that you may be able to use the 'safedivide' function to solve your problem.

SafeDivide([total],[grandtotal],0)

Then change the format of the control to a percentage.

Example: For the 'total' syntax I repeat the calculated formula from my total field and do the same for my 'grand total' field.

Which looks like this:

SafeDivide(count( ) where ([TYPE] = "XYZ" and [LASTDATE]- [LASTAPPDATE] < 121),count() where([TYPE] = "XYZ"),0)


Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top