Link to home
Start Free TrialLog in
Avatar of Mark01
Mark01Flag for United States of America

asked on

Crystal Reports Calculate Percentage

I am trying to calculate the percentage of each security in a given portfolio. The calculation should be value of the security divided by portfolio total. For example, in account 1, first portfolio, the percentage for Select Financial Svcs should be 400/1500 = 0.267.

I tried using a following manual formula ({@Secur_Value} / {@Acct_Sum}), but it does not calculate the correct percentage.

The report is attached. Please help solve the problem.
User generated image
Avatar of Mike McCracken
Mike McCracken

What are the 2 formulas you are using?

I assume you are looking in the first line for 400/1500

mlmcc
Avatar of Mark01

ASKER

In the screenshot, the far right column "Secur_Percent" is the Secur_Percent formula. That formula is ({@Secur_Value} / {@Acct_Sum}).

Yes, I am looking at the first line, Select Financial Svcs, with a value of  400. The current but incorrect Secur_Percent is 0.13

I tried to attach the report file again.
Acct_Value_test.rpt
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark01

ASKER

Thank you, mlmcc. It works now. The two formulas I'm using are:

Acct_Sum2 = sum ({Acct_Value.SecValue},{tblPortfolios.Portfolio})
Secur_Percent2 = {@Secur_Value} / {@Acct_Sum2}