你可以使用一個表達喜歡本作的排除空白問題:
=Avg(IIf(Fields!Question_Text.Value = "" or IsNothing(Fields!Question_Text.Value)
, Nothing
, Fields!Point_Value.Value))
或替代:
評論後
=Sum(Fields!Point_Value.Value)
/Sum(IIf(Fields!Question_Text.Value = "" or IsNothing(Fields!Question_Text.Value), 0.0, 1.0))'Updated
編輯:
我添加了表情進入一個報告 - 第一次工作正常,第二次罰款也很小,更新後(見編輯細節)。
我創建了一個測試數據集用下面的查詢:
select Question_Group = 'Group1', Question_Text = 'Q1', Point_Value = 10
union all select Question_Group = 'Group1', Question_Text = 'Q2', Point_Value = 15
union all select Question_Group = 'Group1', Question_Text = 'Q3', Point_Value = 15
union all select Question_Group = 'Group1', Question_Text = '', Point_Value = 0
union all select Question_Group = 'Group2', Question_Text = 'Q4', Point_Value = 10
union all select Question_Group = 'Group2', Question_Text = 'Q5', Point_Value = 15
union all select Question_Group = 'Group2', Question_Text = 'Q6', Point_Value = 15
union all select Question_Group = 'Group2', Question_Text = null, Point_Value = 0
我剛剛創建了一個組基於Question_Group
並添加兩個表達式的組頁腳。在設計模式
報告:
![enter image description here](https://i.stack.imgur.com/PrxPv.png)
報告結果基於上述數據集:
![enter image description here](https://i.stack.imgur.com/NZAoU.png)
上面一個不工作。它給出了一個無窮大值 – 2013-04-04 20:25:25
它適用於我基於示例數據集;請參閱上文。如果它仍然不適合您,並且您需要進一步的幫助,請提供更多關於您的數據集的信息和查詢以填充上述示例中的一些示例數據。 – 2013-04-04 20:58:26
就像你說的那樣順暢......感謝一噸伊恩...... – 2013-04-04 21:39:28