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

Getting Percentages in Cross tab

Status
Not open for further replies.

PPetronas

Programmer
Nov 13, 2008
14
US
Hi,

I am using a cross tab. There is a formula for Percentage which is as follows :
if {Command.Label}= "A" then 0
else if {Command.Label}= "B" then
if {Command.initial_count} = 0 then 0
else ({Command.Counts}/{Command.initial_count}*100)
else if {Command.failed_count} = 0 then 0
else ({Command.Counts}/{Command.failed_count}*100)

Under the summarized fields when I choose 'Weighted Avg of Command Percentage with command.initial_count' I get the correct %'s where Label = 'B'. If I choose 'Weighted Avg of Command Percentage with command.failed_count' I get incorrect %'s for Label B, but correct %'s for Label C. Is there a way I can handle this? I am using Crystal Reports 2008.

Thanks in advance,
Petronas
 
Why not use a formula for your weight that uses the same criteria? E.g.,

if {Command.Label}= "A" then
1 else
if {Command.initial_count} <> 0 and
{Command.Label}= "B" then
{Command.initial_count} else
if {Command.failed_count} <> 0 and
{Command.Label}= "C" then
{Command.failed_count}

-LB
 
Thanks LBass. How do I tie in the weight formula with my percentage formula? I am sorry I don't use Crystal reports frequently.

Thanks in advance,
Petronas
 
In the summarized Fields I did the 'Weighted avg of Command.Percentage with @Weight'. The row totals %'s are not calculated correctly. Is there a way that I can fix this?

Thanks in advance,
Petronas
 
You'll have to describe in what way the results are incorrect.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top