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

Sum of percentage on group footer

Status
Not open for further replies.

mohsinhasan87

Programmer
Aug 1, 2012
12
AE
Another issue is --

I have one formula which shows the percentage according to gross we just calculated above. I used this formula to show percentage of gross.
shared numbervar rtTotal;
local numbervar thisTotal;
thisTotal :={dt_VU_GETMSG_SERVICE.TOTALAMOUNT_} % Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK});
rtTotal :=rtTotal+thisTotal;

and created a new formula for displaying the summary like this
shared numbervar rtTotal;
rtTotal;

but on my report it keep adding the record in the next field.
For Eg:

Details:
Name Percentage
ABC 20%
XYZ 29% ---> Original Value 9%
DFG 31% ---> Original Value 2%

At the end on group footer it shows 31%(last value).

I want to sum all the percentage field on details and show them on group footer.How can I achieve this?

Thank you
 
Im trying to understand ....
I know why the footer shows 31% but I am having a hard time understanding your goal here..

what do you mean by original values?



_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
Footer shows the last value on details which in this case is 31 % and for original value I mean it is summing up the next value like first value is 20% and next value 9% but it shows 20+ 9 =29% and so on.
 
use the formula I gave in your other thread for detail section

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
That formula you mentioned would only give me percentage based on my fields but how can I show summary on group footer?

This formula will show data on details tab.
{dt_VU_GETMSG_SERVICE.TOTALAMOUNT_} % Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK})

What will be the formula to show summary of percentage on group footer ?
 
you have a group footer? {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK}?

based on your formula isnt that always going to be 100?



_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
Yes {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK} is group footer.Yes It always show 100 based on my formula.But If I use simple formula it shows the last value
 
ok then create another formula and place in group footer if thats what you really want


Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK})
%
Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK})


_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
But I want summary of my formula which is going to be this

{dt_VU_GETMSG_SERVICE.TOTALAMOUNT_} % Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK})

What you have suggested will give me percentage of group footer field only.

I will explain you again ,I have one formula which shows percentage by this formula.

"{dt_VU_GETMSG_SERVICE.TOTALAMOUNT_} % Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK})
Detail field % Sum(Group Footer field)"

Now how can I achieve summary of the above formula on group footer.
 
somone else is gonna have to pick up on this for you. I have no idea what you are looking for ..

the summary of your formula is going to be 100% if placed in the footer of {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK}

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
shared numbervar rtTotal;
local numbervar thisTotal;
thisTotal :={dt_VU_GETMSG_SERVICE.TOTALAMOUNT_} % Sum ({dt_VU_GETMSG_SERVICE.TOTALAMOUNT_}, {dt_VU_GETMSG_SERVICE.FSERVICE_NETWORK});
rtTotal :=rtTotal+thisTotal;
thisTotal //this will cause the current value to be displayed
//while you are summing in the background.

Then add a formula like this to the group footer:

whileprintingrecords;
shared numbervar rtTotal;

Add a reset formula to the group header:

whileprintingrecords;
shared numbervar rtTotal;
if not inrepeatedgroupheader then
rtTotal := 0;

-LB


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top