英文:
How do I display data from different dataset in SSRS report matrix using expression with conditions
问题
=sum(iif(Fields!week.Value <> 5, Fields!Received.Value, "DATASET2", 0)) / 5
我得到了这个错误。
[rsFieldReference] 文本框 'Textbox9' 的值表达式引用了字段 'Received'。报表项表达式只能引用当前数据集范围内的字段,或者如果在聚合函数内部,则引用指定的数据集范围。字段名称中的字母必须使用正确的大小写。
你可以提供的任何帮助将不胜感激。
英文:
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.
答案1
得分: 1
=SUM(IIF(Fields!week.Value <> 5, Fields!Received.Value, 0),"DATASET2") / 5
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论