views:

183

answers:

1

I have a group in reporting services 2005. In one of the header cells i have the following expression:

=IIF(Sum(Fields!DataInGb.Value) < 2, 0, Sum(Fields!DataInGb.Value) * 3 - 6)

In the report footer I need to sum the values of this cell for each group.

An example list of values returned by the dataset might be:

Cust 1 | 0.5
Cust 1 | 0.7
Cust 1 | 1.2
Cust 2 | 0.1
Cust 2 | 0.2
Cust 4 | 1.1

So that would mean 3 groups:
Cust 1 = 2.4
Cust 2 = 0.3
Cust 4 = 1.1

With expression values:
Cust 1 = 1.2
Cust 2 = 0.0
Cust 4 = 0.0

The report total should then be 1.2.

When I tired to use the same expression as above in the report footer, I got the value 0 since all the items in the dataset are less then 2. The expression needs to be performed on the group sums.

Can anyone suggest an expression to acheve this?

A: 

Hi, Hi,your problem is very interesting but i found a solition in reporting service you can sum cell from the report itself so you do something like this

= Sum( Fields!Textbox1.Value )

where Textbox1 is the of the cell that contains the sum for the group

IordanTanev
Edited with more information
Anthony
The expression will give the the sum of the current scope, not of the total dataset.
Anthony
Hi, the put the this expression in the footer by replacing "group name" with the name fo you group =IIF(Sum(Fields!DataInGb.Value ,"group Name" ) < 2, 0, Sum(Fields!DataInGb.Value ,"group Name") * 3 - 6)
IordanTanev
The group expression is not the issue here. However I have made this change and there was no difference.
Anthony
The reason the report sum doesnt work is beacause is is performing its calculation on the sum of the dataset. This is incorrect due to some of the summed values will be in a group where the total is < 2. This leads me to the expression: =IIF(Sum(IIF(Fields!DataInGb.Value < 2, 0, Fields!DataInGb.Value)) < 2, 0, Sum(IIF(Fields!DataInGb.Value < 2, 0, Fields!DataInGb.Value)) * 3 - 6) This however is 0 since none of my dataset are over 2 so none are summed.
Anthony
Ok try this expression=SUM(IIF(Sum(Fields!DataInGb.Value, "group_name") < 2, 0, Sum(Fields!DataInGb.Value, "group_name") * 3 - 6) )Here group_name is the name of the grouping in the Report Table( Report List )
IordanTanev
Nested sums are not allowed in Reporting Serivces.
Anthony