Reputation: 53
I have a matrix report that references a specific dataset (DATASET1). I need to be able to add a row of data from a separate dataset (DATASET2) but I also need to add conditions to the expression.
This is what I'm currently using and it does populate data.
=Sum(Fields!Received.Value, "DATASET2") / 5
However, I need to add logic to the expression to only look for rows where the week value is not equal to 5.
This is what I've tried:
=sum(iif(Fields!week.Value <> 5, Fields!Received.Value,"DATASET2" ,0)) / 5
I'm getting this error. [rsFieldReference] The Value expression for the text box 'Textbox9' refers to the field 'Received'. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.
Any help you can provide would be appreciated.
Upvotes: 0
Views: 464
Reputation: 10860
I think you just need to move the dataset reference to outside the IIF statement to make it work right.
=SUM(IIF(Fields!week.Value <> 5, Fields!Received.Value, 0),"DATASET2") / 5
Upvotes: 1