Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula error Post Reply Post New Topic
Author Message
hendrikb
Newbie
Newbie


Joined: 26 Jan 2010
Online Status: Offline
Posts: 5
Quote hendrikb Replybullet Topic: Formula error
     Posted: 25 Jul 2010 at 7:27am
Hi

I have 2 formulas which holds a value for the current and previous year
Product_CY and Product_PY
I want to add another formula that calculates the growth between the
two years, I tried Product_CY - Product_PY / Product_PY
The answer I get is wrong, and not sure if it is to do with the groups in my report.
I have 3 groups CustomerGroup, Region and CustomerName which is the detail
and I place my formulas in the CustomerName group header.

Any ideas?
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 25 Jul 2010 at 9:07am
would you mind to put an example data here?
 
i think, if you want to know the growth of your product then just subtract last year product with current year product.
e.g.:
   thediff = Product_PY - Product_CY
 
but if you want to know the average of the growth between past year and currentyear:
theavg = (Product_CY + Product _PY) / 2
 
and if you want to know the percentage for currentyear:
theCYprctg = (Product_PY - Product_CY) / Product_CY
 
and percentage for past year:
thePYprctg = (Product_PY - Product_CY) / Product_PY
 
 
 
hope it help.
 
Emir W
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