Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Percentage by Row Post Reply Post New Topic
Author Message
nhopp4
Groupie
Groupie


Joined: 03 Oct 2012
Location: United States
Online Status: Offline
Posts: 62
Quote nhopp4 Replybullet Topic: Percentage by Row
     Posted: 11 Oct 2013 at 9:10am
Hi Guys,
I am trying to figure out a method to calculate a percentage by each row.  Currently I have a formula that works correctly it is based on the display string in a cross tab.
numbervar z:=0;
z:=currentfieldvalue/(SUM({@TotalAboveIn}))*100;
totext(z,2)+"%";
 
however, I have different totals by row and would like the it to use the row total instead of the main one. 
Any idea?
 
Thanks,
Nick
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Oct 2013 at 4:47am
if it wasn't a crosstabs report, it wouldn't be too bad...I think, but crosstabs puts a twist that I am not sure how to get around off the top of my head
IP IP Logged
nhopp4
Groupie
Groupie


Joined: 03 Oct 2012
Location: United States
Online Status: Offline
Posts: 62
Quote nhopp4 Replybullet Posted: 14 Oct 2013 at 8:39am
Thanks for responding.. Yes, this one is going to be tricky thats why I am asking the experts here :)
 
Here is what the crosstab looks like:
         % Above | % Below | Total
1            40%       60%        3256
2                                          2800
3                                           450
 
I want to calculate %'s for each row by using the total that is on that row.
 
Thanks!
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Oct 2013 at 10:52am
maybe don't use the sum of the @totalAbove...just use @totalAbove...not sure since I don't what it does...
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 14 Oct 2013 at 2:32pm
maybe a formula like
amount / sum(amount)

in cross tab options
choose sum
show as percentage
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum