Showing posts with label sum. Show all posts
Showing posts with label sum. Show all posts

Monday, March 26, 2012

Getting #Error with aggregate function

Why doesn't this return a value?
=Sum(IIf(Fields!GroupCode.Value = 10, Fields!Rating.Value, 0))
I am getting #Error as the value. This however gives me a value:
=Sum(IIf(Fields!GroupCode.Value = 10, 1, 0))
However, I need the above to work...I need it to sum the rating if it's
part of a particular group.Here are some additional findings...
The following code works:
=Sum(IIf(Fields!GroupCode.Value = 10, CInt(Fields!Rating.Value), 0))
The following code fails:
=Sum(IIf(Fields!GroupCode.Value = 10, 1.20, 0))
=Sum(IIf(Fields!GroupCode.Value = 10, CDbl(Fields!Rating.Value), 0))
Why is it that it can only sum up intergers?|||I figured it out!!
The following code works:
=Sum(IIf(Fields!GroupCode.Value = 10, 1.20, 0.0))
Both the true and false values need to be of the same type. By return
0 as my false condition value, and 1.2 as my true condition, it caused
it to fail because it's returning different data types base on the
different condition.
This is bad, MS needs to fix this.

Sunday, February 26, 2012

get second dataset value

hi,

how do I get value from second dataset (in multi dataset report)

in some function it provide scope parameter like

Sum(Fields!amount.Value, "DS2")

but now I need to show the value without using function

thks,

Can you please let us know where you are using this expression and what was the exact requirement you are looking for.

Actually sometimes when we face the issues like this

we use to place

=First(Fields!amount.Value, "DS2")

Hope if you are grouping is correctly ,you should be able to write the expression with out function.

Thank you,

Raj Deep.A

|||

ok I create 2 dataset and 2 table on a report . I just want to show list out the record . on table 1 it work find but on table 2 it give error that the field name is not in scope . I already set datasource on table 2 to dataset2 . on exepression window only show me field of dataset1 .

how do I resolve this