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

How to calculate Percentage of Total

Status
Not open for further replies.

ksaab2002

MIS
Jan 6, 2005
66
US
I am using details to make a simple formula @exchange. The formula has a Sum (Sum @exchange) in a group header as well as a grand total sum (Sum @exchange) in the report footer. How do I caculate what percent of the (grand total sum) the group sum is?

Many many thanks in advance!

 
Try:

sum({@exchange},{table.groupfield}) % sum({@exchange})

Substitute your group field for {table.groupfield}. If this doesn't work, then we need to know the contents of {@exchange}.

-LB
 
I tried the solution above and it resulted in all 0's?


@exchange =

if{tickets.TICKET_DATE}>={?cystart} and {tickets.TICKET_DATE}<={?cyend} and
{tickets.EXCHANGE_FLAG}="X" and {tickets.REFUND_FLAG}="R" then 1 else 0

Thanks!
 
I wonder whether you really mean:

if{tickets.TICKET_DATE}>={?cystart} and
{tickets.TICKET_DATE}<={?cyend} and
(
{tickets.EXCHANGE_FLAG}="X" or
{tickets.REFUND_FLAG}="R"
)
then 1 else 0

Surely the same ticket can't be both exchanged and refunded? No records would then meet your criteria.

-LB



 
In my world lots of odd things are possible ;) Thank you for your help. I was able to get the result I wanted. I used the sum function wizard and added a group level and it worked. Not sure exactly how but its Friday and it will do! Thank you very much though - I will keep a note that it is possibble to point to a group level in a frmula..

Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top