cancel
Showing results for 
Search instead for 
Did you mean: 

calculate average values excluding rows with 0 values

Former Member
0 Kudos

Suppose I have the following column in a report like this:

2

3

0

4

0

at the bottom of this column, I want to add the average value. The average function in CR gives 1.8 of above data (because (2+3+0+4+0)/5 =1.8) . What I need is (2+3+4)/3=3 I want exclude all 0s when calculate average values. How can I do that in CR?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Gary,

Expand the Field Explorer > Right-click Running Total Field > New.

Choose this number column as the 'field to summarize'.

Choose 'Average' as the 'Type of summary'.

Under 'Evaluate', choose 'use a formula' and click the formula button beside it. Use this code inside the formula:

{Field_to_average} > 0

Drag and drop the Running Total on the Report Footer.

-Abhilash

Former Member
0 Kudos

Thanks Abhilash!  Work like a charm!

Answers (0)