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!

Cross Tab: Get Average of Non-Zero Records

Status
Not open for further replies.

jocom67

Programmer
Jun 15, 2009
2
US
I'm using Crystal Reports v9
How can I get the average of non-zero records on a cross tab report? What's happening is that even the zero records are automatically included in the calculation of the cross tab average function.

Thanks for the help.

 
Please explain the setup of the crosstab: rowfield, columnfield, summary, and whether you are looking for averages per row or per column. IT would help to see a sample of what the crosstab looks like and also show what you expect the average to be for that sample.

-LB
 
Column1 Column2 Column3 Total
Avg Bet 0 0.82 0.83 0.55 (Avg)
No.of Games 3 1 5 9 (Sum)

Shown above is how my report looks like, it shows the setup of my crosstab report. If you'll look into the Avg bet row (0.00 + 0.83 + 0.82 = 1.65) the avg bet on the Total column is (1.65/3 = 0.55) because includes the zero value and is being divided by 3 instead of 2 (eliminating the zero value). How do you get the average of only non-zero values?

Thanks again.
 
I was looking for the names of your row, column, and summary fields. It looks like you don't have a row field, but instead just two summaries. What is the name of your column field inside the crosstab expert?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top