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

calculating diff of percentage in cross tabs..

Status
Not open for further replies.

abhi900

IS-IT--Management
Jul 1, 2010
117
AU
Hello,
I have a problem in trying to show a percentage on a Crystal Reports XI cross tab reports. The requirement is to show the difference of percentage of growth from month to month basis.

Looks something like this"

Total / Jan07 / Feb07 / Mar07
_______/_______/__________/__________
Prjcode1 / 60% / 90% / 100%
Prjcode2 / 45% / 60% / 80%
Prjcode3/ 75% / 100% / 100%

etc...etc...

How do I calculate a percentage of the growth month to month for each month? should look something like this..

Total / Jan 2007 / Feb 2007 / Mar 2007
________/___________/___________/__________
Prjcode1 / 60% / 90% / 100%
/ / diff-30% / diff 10%
Prjcode2 / 45% / 60% / 80%
/ / diff - 15% / diff -20%
Prjcode3 / 75% / 100% / 100%
/ / diff - 25% /

I've tried several things, but nothing is working. Any help would be greatly appreciated.

Thanks
 
I've tried several things
It would help if you said what. My suggestion is a month-based field that finds the difference between that month and the next. But maybe you've tried it.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Instead of using date (on change of month) as your column field, create a separate summary for each month based on a formula:

if month({table.date}) = 1 and
year({table.date}) = 2007 then
<field to summarize>

Format the summaries to a horizontal display. Then you can insert a formula (to act as a holder) multiple times, one after each summary (except the first):

//{@0}:
whilereadingrecords;
0

Then select the first summary {@Jan 2007}->right click->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar jan2007 := currentfieldvalue;
false

Then select the second month summary {@Feb 2007}
->right click->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar feb2007 := currentfieldvalue;
false

Then select {@0}->right click->format field->DISPLAY STRING->x+2 and enter:

whileprintingrecords;
numbervar jan2007;
numbervar feb2007;
totext(feb2007-jan2007,1)+"%"//1 for one decimal

Repeat for other summaries.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top