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!

Percentage Growth formula

Status
Not open for further replies.

henb

Technical User
Feb 1, 2010
1
ZA
Hi
I am new to Crystal and trying to write a percentage growth
formula but not sure how to do this.
In my table I have a year column with two years information(2008 & 2009) product and a value.
If i get the formula correct I want to display in a cross-tab report the two years at the top with the growth formula and the product on the left.
 
Try
Code:
{Value1}%{Value1}
That's assuming the values are always there, otherwise you need to add some logic to test. Divisions by zero stop a run.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
It would be simpler just to create a manual crosstab like this. First insert a group on product, and then create two formulas:

//{@firstyr}:
if {table.year} = minimum({table.year}) then
{table.amt}

//{@secondyr}:
if {table.year} = maximum({table.year}) then
{table.amt}

This assumes you have limited the report to two years in your record selection formula.

Then insert sums on these at the product level, drag the groupname into the group footer and suppress the group header and detail section.

Your growth formula (for the group footer) then becomes:

(sum({@secondyr},{table.prod})-sum({@firstyr},{table.prod})) % sum({@firstyr},{table.prod})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top