Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get the Avg(Sum(Field!xxxx.value)) in ssrs expression..

How to do it..
If am using the above format if showing the error like

" Aggregate functions cannot be nested inside other aggregate functions."


Please help me ..
Thanks in advance.
Posted

1 solution

Think about it:

What is a SUM value? It's a single value which is all the values added together - it's called an Aggregate Function because it aggregates a list of values into a single value.

What is a AVG value? It's a single value which is the average of the values added together - it's also an Aggregate Function because it aggregates a list of values into a single value.

So why would you expect to be able to take an average of a sum?
C#
double d = Average(1 + 2 + 3);
is meaningless in every language, because it is the equivalent of taking the values 1, 2, and 3, adding them together and then dividing the result by one...
 
Share this answer
 
Comments
kanamala subin 12-Dec-13 7:52am    
I know this things..

Here my requirement is different..
For example in my report have 4 columns(Class,Subject,Name,Marks)and 2 drill-downs..
First drill-down started with Class
When I expand class will get all Subjects.
When I expand Subjects I will get Name and Marks.
In these Class and Subjects are row groups.And name and Marks are details.
In these suppose Marks column(detailed column) is the SUM(Marks Field)
So I need the average marks in top(Collapsed stage of Subjects).
Suppose marks field contains 0 values(20,0,34).
So SUM(Marks field)=54..
Many rows will come like this,

CLASS Subjects Name Marks
Class A -
Maths + 80
English+ 58
Hindi - 23.666
Subin 30
Visal 29
Rani 12
Here how can I get 23.666 IF 30,29,12 are the SUM(marks field)
Means 23.666 is the AVG(SUM(Marks field))

That is my problem

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