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

Crystal Reports Percentage Issue

Status
Not open for further replies.

oxygen101

Programmer
Jul 31, 2008
28
US
I have a cross tab report in CR 9 that shows the following data including percentage symbol and position -123%.

Turnaround Time Total Days Percentage
# of Days 45 8%
# of Days 215 40%
# of Days 108 20%
# of Days 122 22%
# of Days 44 8%
Total 534 100

I have selected the "show as a percentage" of option in the crosstab but the percentage never add up to 100%- this adds up to 98%. I also tried to expand the decimals hoping that was the issue but they just stay the same.

I need help. Anyone have any ideas? I saw that there may be a bug in Crystal but can't seem to find a good solution.

Thanks in advance.
 
Hi,
Try formatting for 4 or 6 decimal places - for instance

122/534 = 22.8464
108/534 = 20.2247
45/534 = 8.4269
215/534 = 40.2621
44/534 = 8.2397
---------
total % = 99.9998 ( Rounded to 100%)





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I have tried to use decimals but it reverts back to Decimals being at 1 instead of 1.0000.

I just don't understand.
 
Hi,
try formatting the source numbers in 4 decimal places to see if it carries over into the XTab...

Otherwise, maybe someone else here more familiar than I am with formatting Cross-tab output will reply.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I'm unclear on what your row field is since you are displaying the same value in each row. I'm assuming that Total Days is your first summary. Remove your percentage summary and replace it with the following formula {@total}:

count({table.totaldays})

Use a maximum on this formula in the crosstab.

Next, in preview mode, select your first summary in both inner cell and column total->right click->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar curr := currentfieldvalue;
false

Then select the second summary (maximum of {@total})->
right click->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar tot := currentfieldvalue;
false

In the same screen, select display string->x+2 and enter:

whileprintingrecords;
numbervar curr;
numbervar tot;
if tot <> 0 then
totext(curr%tot,2)+"%"//2 for two decimals

-LB
 
lbass,

This is what I did.

The first summary-separate from the 2nd, which still contains the count of days_open with the formula you provided,

whileprintingrecords;
numbervar curr := currentfieldvalue;
false

The second summary-which is completely separate from the first one, which previously contained the percentage of the count of days_open is now Max of @{total} and with the formula you provided,

whileprintingrecords;
numbervar tot := currentfieldvalue;
false

In the same screen, select display string->x+2 and enter:

whileprintingrecords;
numbervar curr;
numbervar tot;
if tot <> 0 then
totext(curr%tot,2)+"%"//2 for two decimals

I put all of this as you said, I hope I did it right, and the first summary is now showing up as 44.00, 234.00, 179.00, 82.00, 27.00 total 566.00. and the second summary shows nothing except the total is now 0.00.

Need further assistance please. Thanks again.
 
I can't tell whether you placed these formulas in the correct formatting areas. Your "first" summary must appear first in the summary window. The formatting formula for that would not change the value if placed correctly.

Before formatting, the max of {@total} should show the same value throughout and should match your total for total days.

For more help, you will need to be more specific about each step you took.

-LB
 
In the count summary, first summary,I right clicked on the field- count of tablename.days_opened, clicked format field, in the common tab, in the x-2 button under Suppress if duplicate area, and entered this formula. (I did not check the checkbox for this)

whileprintingrecords;
numbervar curr := currentfieldvalue;
false

This changed from 44 to 44.00.

Then in the percentage summary, 2nd summary, I added a formula through the formula fields labeled {@total}
then entered in the formula,

count({daysopened.days_opened})

Then I changed the field that's in the summary, of what used to be count of table.days_opened, to Maximum(changed to Max of @{total} ) in the edit summary and left the show as percentage checked. Then I right clicked again, format field, in the common tab, in the x-2 button under Suppress if duplicate area, and entered this formula. (I did not check the checkbox for this)

whileprintingrecords;
numbervar tot := currentfieldvalue;
false

In the same screen, under the Display screen I entered this formula.

whileprintingrecords;
numbervar curr;
numbervar tot;
if tot <> 0 then
totext(curr%tot,2)+"%"//2 for two decimals

This now changed to nothing with in the rows and a total of 0.00%.

I hope I was more detailed now.

Thanks again.
 
When you add Maximum of {@total}, you should NOT have the "show as percentage" checked.

For the formatting change to the first summary, just select the summary in preview mode and click on the decrease decimals icon.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top