我正在尝试计算报告中每个组项的平均加权值。我使用了this link处的所有建议,但所有这些建议都给我以下错误:
警告1 [rsAggregateOfMixedDataTypes]的值表达式 textrun'textbox134.Paragraphs [0] .TextRuns [0]'使用聚合 对不同数据类型的数据起作用。聚合函数其他 比First,Last,Previous,Count和CountDistinct只能 单个数据类型的聚合数据。
有关计算加权平均值的最佳方法的任何建议。我最近的尝试是这样的:
=iif(sum(iif(Fields!weight.Value is nothing,0,Fields!weight.Value))= 0, 0, sum(iif((Fields!myData.Value * Fields!weight.Value) is nothing,0,(Fields!myData.Value * Fields!weight.Value)))/ sum(Fields!weight.Value))
由于
答案 0 :(得分:0)
根据exeption描述,我怀疑你的字段没有设置任何数据集,因此你可以计算聚合函数,如果你使用单个文本框 - 尝试使用表(使用单列并删除行所以你最后会有一个Header单元格,并确保在表格属性中将右边的数据集链接到它。
关于你的表达,试试这个:
=iif(sum(iif(IsNothing(Fields!weight.Value),0,Fields!weight.Value))= 0, 0, sum(iif(IsNothing(Fields!myData.Value * Fields!weight.Value),0,(Fields!myData.Value * Fields!weight.Value)))/ sum(Fields!weight.Value))