Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hi
How to calculate average of a column in rdlc

I have a column name
Average Drop


Average Drop
2
3
5
===============
//expected average is 3,3%


What I have tried:

I tried using the average;

=Avg(Fields!AverageDrops.Value, "dsReport")
//this gives unexpected number

then I tried manually by summing up the column and do an average, this gave me an error
Posted
Updated 5-Dec-17 11:27am

Hello Anele,

It is hard to help without knowing exactly what you rdlc is being populated with. That being said, I would make sure you convert your field to the appropriate data type before passing it to the AVG function:

It should be something like this:

=Avg(CSng(Fields!AverageDrops.Value), "dsReport")


Hope it helps.

Cheers!
 
Share this answer
 
Quote:
this gave me an error

Looks like you need to learn the basics of programming:
An error message tells you the reason of error and its position in code. Along with code, it is the most important information available to help you solve the problem.
You didn't showed either of them.
Quote:
//this gives unexpected number

This is not informative, about anything can lead to this comment.
Showing actual data and result would be more interesting.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900