2012-02-01 28 views
0

Reporting Services中,我已經使用共計基於表達式場

=IIf(Fields!Weekday.Value="Su" 
     or Fields!Weekday.Value="Sa" 
     or Len(Fields!HOLIDAY.Value)>0, 
     (Fields!GENERAL.Value 
     + Fields!LAUNCH.Value 
     + Fields!SHIFT.Value 
     + Fields!OCESAWE.Value 
     + Fields!OCESAWD.Value 
     + Fields!WEPHWORK.Value 
     + Fields!OCREMWE.Value 
     + Fields!OCREMWD.Value) * 1.5, 
    (Fields!GENERAL.Value 
     + Fields!LAUNCH.Value 
     + Fields!SHIFT.Value 
     + Fields!OCESAWE.Value 
     + Fields!OCESAWD.Value 
     + Fields!WEPHWORK.Value 
     + Fields!OCREMWE.Value 
     + Fields!OCREMWD.Value) 
    ) 

爲了得到一個所謂的「加權總」 columnn,這列有幾行。

1. ID   Total Weighted 

2. 111   21 
3. 121   49 

我怎樣才能得到總的「總加權?

回答

0

創建數據集的計算的字段,並使用你作爲該字段的值提供的公式。現在,您可以指現場的其他地方,如果它來自你的數據庫

,那麼你會在你的表矩陣使用像=SUM(Fields!TotalWeighted.Value)表達

+0

謝謝傑米我嘗試這樣做,它給了我錯誤:。「用於計算的表達field'= SUM(Fields!TotalWeighted.Value)'包含一個aggre Gate,RowNumber,RunningValue,Previous或lookup函數。集合,RowNumber,RunningValue,Previous和Lookup函數不能用於計算字段表達式。 – user1143563 2012-02-02 09:07:21

+0

計算的字段不應包含聚合。它應該只包含你的問題的原始公式。這將爲您提供數據集每行的條件值。然後在你的tablix或你需要顯示總數的地方使用聚合表達式('= SUM(...)')。 – 2012-02-02 15:15:37