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

Cross Tab Percentage

Status
Not open for further replies.

trenttc

Technical User
Feb 25, 2002
68
US
The Cross tab column is date and row is category. The summarized fields are A sum, B sum, and A+B sum. I want the summarized A sum and B sum to show a percentage of A+B sum, not show a percentage of all A sum or B sum. CR 11
Date 1 Date 2
Category 1 A sum% A sum%
B sum% B sum%
A+B sum A+B sum
 
Do a formula field, A+B, then see if it will summarise. Should work.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I created 3 formulas: A sum; B sum; A+B sum. In the cross tab, I summarize these formulas. I get correct amounts but I want A sum/A+B sum (B sum/A+B sum) percentages per row. A running total that resets might work but I don't want a group by.
 
Posted solutions (lbass) to cross tab percentage problems can involve creating a formula, then summing that formula in a cross tab and creating running totals inside that summed formula:

Select (Sum of @formula}->right click->format field->suppress->x+2 and enter:
whileprintingrecords;
numbervar ABtot := ABtot + currentfieldvalue;
false

The problem I was having was getting the running total to reset when the row changed. How to do that was in one of the posts:

Select (Sum of @formula}->right click->format field->Border->Background->x+2 and enter:
whileprintingrecords;
numbervar A+Btotal := 0;
crNoColor

Thanks lbass.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top