Reputation: 9081
I'm using Crystal reports in my application
average({ConsultationDetail.viandenord} )
I need to get the avearge of not null field viandenord
Upvotes: 0
Views: 305
Reputation: 9101
Try below code.
If(ISNULL({ConsultationDetail.viandenord}))
Then //Your code
Else average({ConsultationDetail.viandenord} )
Edit:....................................................................................... Assuming you have placed your fields in detail section:
Create formula @sum
and place below code in the detail and take sum
of the field.
If(ISNULL({ConsultationDetail.viandenord}))
Then //Your code
Else {ConsultationDetail.viandenord}
To calculate count create formula @count
and write below code and place it after the @sum
in detail section.
if {ConsultationDetail.viandenord}=0
then 0
else 1
Now take sum of the formula @count
To calculate Average
Sum({ConsultationDetail.viandenord})/Sum(@count)
Above code is just an example.. Let me know how it goes
Upvotes: 2