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

Calculate % Column by Running totals

Status
Not open for further replies.

satyakumar

Programmer
Jun 29, 2008
44
0
0
US
Hi Folks,

I want to calculate % of a column based on the Running totals.
-------------------------------------------------------------

I have a group in a report which is a formula called @Type.
So @Type Group returns date like this.
YEAR-2012
---------
Intra
-----
ABCD 500
CDEF 1500
EFGH 1000
-------
Total: 3000
-------

Extra
-----

AEDD 1500
DFDD 500
GDSD 500
-------
Total: 2500
-------
-------
Tot Intr + Tot Extra: 5500
-------
Inexta
-----

HJHK 100
YTYT 1500
YUYY 1000
-------
Total: 2600
-------


So in the above report i want to calculate the % column of YEAR 2012. So my formulae is

YEAR 2012/(Tot Intr + Tot Extra) *100

So howdo i calculate the formulae.

Right now i am using Running total to get the (Tot Intr + Tot Extra) in the Report. But when i add running total in the formualae its not calcluating correctly.

Note: I can do like this YEAR 2012/sum(YEAR 2012) *100

But i dont want to add Inexta total in the % calculations.

Please help me in resolving this issue.

Thanks
Satya





 
First, do you really need to be using running totals? Is the data you are showing at the ABCD level the detail section data? If so, you can just create and outer group by using a formula {@grp1}:

if {@Type} in ["Intra","Extra"] then 1 else 2

Insert a group on this formula and make it your group #1. You can suppress the group header.

Create a second formula {@IntraExtra}:

if {@Type} in ["Intra","Extra"] then {table.value}

Then use a formula like this for your percentage at the detail level:

{table.value}%sum({@IntraExtra},{@grp1})

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top