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!

Summarize Percentage field 2

Status
Not open for further replies.

maas

Programmer
Sep 3, 2009
148
BH
Hello,

Well, I am having difficulties while preparing 2 formulas to summarize the percentage field. My report has a group which is called currency and inside that group I am calculating the percentage for each field by using a formula.
Now, my problem is that I am trying to Sum the percentage for each group(Currency), but it is giving me an error "The field can not be summarized". As well as, I am trying to calculate the Sum of the percentages of each group and have a grand total of percentages at the end of the report. So, I am stuck in these 2 areas.

Please, can you help me with these issue.
Your help is appreciated.
 
show your formula you are using for the percentage

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
The formula I used for the percentage : Market Percent which is a field divided by grand total of the previous field which is rmrate. It means that I have created a formula: {@MarketP}/{@rm}
 
When asked to show a formula, you should show the content of any nested formulas as well.

-LB
 
{@MarketP}/{@rm}
{@MarketP}=Capital(field from the DB) * Backrate( field from the DB) / 100

{@rm}= Sum (Values)+ Content Price(field from the DB)
 
I think it would be more helpful if you showed the actual formula instead of a description. I wonder, for example, whether your sum(values) is per some group or for the report as a whole.

It would also help to know what fields you are grouping on and at what level you want the summaries (which group). You can handle this with variables. Let's say you have only one group, and that you want a sum of percentages at the group level and at the grand total level. Create these formulas:

//{@reset} to be placed in GH#1:
whileprintingrecords;
numbervar sumpct;
if not inrepeatedgroupheader then
sumpct := 0;

//{@accum} to be placed in the detail section (if that's where the percentages are):
whileprintingrecords;
numbervar sumpct := sumpct + {@yourpctformula};
numbervar grtotal := grtotal + {@yourpctformula};

//{@displaygrp} to be placed in the GF#1:
whileprintingrecords;
numbervar sumpct;

//{@displaygt} to be placed in the report footer:
whileprintingrecords;
numbervar grtot;

-LB
 
Hello,

Well in fact my report structure is:

GH #1 (Currency field from the DB) group by currency
GH #2 (Code1 retrieve from the DB)
GH #3
GH #4
Details Description values, {@Total Market}={Acc.mr}{Acc.FACE_VALUE},{@ CCY}= {@Total Market}/{@ Sum_Total_CCY}*100
GF #4
GF #3 {@ Sum_Total_CCY}=Sum ({@Total_CCY},{gltnrpt.CCY"GH1"})+{@sum_dr_cr}, My problem is here while writing this formula: Sum({@ CCY} it is showing a an error that the field can not be summarized.
GF #2
GF #1
Report Footer
I need to get this value, so I can place the grand total of the Sum({@ CCY} at the report footer where I am also stucked.

Could you help me along these formulas.

 
You reference the problem with your formula "Sum({@CCY}" but I can't tell what you are referring to, since none of your formulas are named that or use that exactly. Are you trying to use the sum of a detail level formula within another formula at the GF#3 level? What exactly are you trying to sum for the report level? Is it the new calculation at GF#3?

Please reread your post and rewrite it using consistent formula names, and then we can move forward. You would still use the technique in my previous post.

-LB
 
Hello lbass

I created a formula in the details section called{@ CCY}= {@Total Market}/{@ Sum_Total_CCY}*100 and it is showing the data correctly.

Now I am trying to create a new formula in the Group Footer #3 called {@ Total_CCY} which is calculating the sum of {@ CCY} and place the total in the Group footer #3. But, I am getting an error that the field can not be summarized.

I need to get this value so, I can create another formula and get the sum of all {@Total_CCY} for each group and place the total in the report footer.

I hope this will clear my idea.
 
Then use the formulas in my earlier suggestion, and place the {@reset} formula in the GH#3, place the {@accum} formula in the detail section, the {@displaygrp} formula in the GF#3, and the {@displaygt} formula in the report footer. In the {@accum} formula, replace {@yourpctformula} with {@ CCY}. Suppress the {@reset} and {@accum} formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top