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

summary formula

Status
Not open for further replies.

OT2

Technical User
Jan 14, 2005
54
US
Hello,

I am using Crytal Reports 9 to create a report. The report is currently grouped by portfolio, equity group and country. I have a column called PCT of Assest wich I would like to summarize at the bottom of the report for every country. The formula for pct of assets is:

{@Mkt_Acc} / sum( {@Mkt_Acc}, {@PortName} ) * 100

I am having a hard time summarizing this data individualy by country. I have not been able to use sum(fld,conFld,""). Does anyone recommed a formula? For example:

if GroupName ({Appraisal.Country Name}) = "BRAZIL"
then {@Mkt_Acc} / sum( {@Mkt_Acc}, {@PortName} ) * 100

Thank you OT2
 
correction: I am trying to summarize the data at the portfolio level by country
 
Try using a Running Total. They can be set to be specific for groups, can calculate percents and also apply formulas.

Their big drawback compaired to Summary Totals is that they 'run' alongside the data as it is printing, and this can't be known for a group priot to the end of the group. But since you anyway put the data at the end of the group details, that should be fine.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Thanks for your help Madwac
 
Madwac, any suggestion on how to get the running totals to show me individually the pct of assets by country, only for corporate bonds? ie:

Argentina Brazil Colombia
portfolio1 Sum%BondAssets Sum%BondAssets Sum%BondAssets
portfolio2 Sum%BondAssets Sum%BondAssets Sum%BondAssets

thanks, OT2
 
You'll need a formula in the running totals, I think.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
OT,

I'm sure I'm misunderstanding your data somewhere, but if you were grouping by country, you can get % by country using: {@Mkt_Acc} / sum( {@Mkt_Acc}, {@Country} ) * 100.

However, assuming I have missed something with that approach, if you were going to go with running totals, you'd have to make running total for each country, and apply a percentage calc to the summary.

Alternatively, you could use variables in the following fashion:
Code:
WhilePrintingRecords;
NumberVar Argentina;

If {Country} = "Argentina" 
Then Argentina := Argentina + Sum%BondAssets
Else Argentina := Argentina;
Add in as many variables as you need into the formula.

Your % summary will use the variable totals, instead of the summed data you're currently trying to use.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top