Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Calculating Percentage Post Reply Post New Topic
Author Message
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Topic: Calculating Percentage
    Posted: 20 Aug 2014 at 4:49am
I am trying to calculate the % change from one year to the next and it just isn't working. Can someone else look at this and tell me what I'm missing?  My report looks something like this:

Current Assets         Last Year        This Year
   Cash on Hand          $$$$                $$$$


Cash on Hand is in GH3.

I want to calculate the % of change from one year to the next. This is my formula:

((Sum ({@Last Year}, {FLP003.REP5})-Sum ({@This Year}, {FLP003.REP5}))/Sum ({@Last Year}, {FLP003.REP5}))*100

I have checked multiple times and I am selecting the correct group summary (Group #3). Any suggestions? My formula keeps returning the same value for every group. The only other problem that I can see is that maybe the report is confused by the fact that I have the report grouped 3 ways on the same field? Even so, I am certain that I'm selecting Group#3: FLP003.RE05 - A: Sum of @This Year and Group #3: FLP003.RE05 - A: Sum of @Last Year for my calculations.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 20 Aug 2014 at 7:43am
How are you displaying the Last Year and This Year's Cash on Hand.  Is it the {@Last Year} and the {@This Year} formulas? Have you displayed the individual sums (in separate formulas) in your GF and see what you are getting?
IP IP Logged
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Posted: 20 Aug 2014 at 9:43am
Yes...Last Year and This Year are formulas. One of the formulas:

if {FLP004.PSTPER} = {?Last Year Posting Period} then {FLP004.CYCR04}+{FLP004.CYDR04}

When I look at the % being displayed with the formula above, it's the % calculation for the summary in GF1. This percentage is being displayed on every row of GH3. I'm not sure if I'm explaining that clearly, but here's what it looks like:

Current Assets         Last Year        This Year        % Chg
   Cash on Hand          $$$$                $$$$            -7.11%
   CD                            $$$$                $$$$            -7.11%
   Accounts Rec            $$$$                $$$$            -7.11%

-7.11% is the actual correct % for GF1 (or Total Assets).

IP IP Logged
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Posted: 20 Aug 2014 at 11:52am
Just a note to let anyone reading know how I solved this problem...

As I said before, I had the report grouped 3 ways on the same field. When I reconfigured the report so that this field {FLP003.REP5} was used in grouping once, everything worked perfectly. I created formulas using {FLP003.REP5} and grouped on the formulas to solve the problem.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 20 Aug 2014 at 11:53am
Is {FLP003.REP5} the field you're grouping on in Group3? If not, you need to change it to match the field for Group3.

-Dell
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.