2013-11-28 25 views
0

同一數據集參數的匹配字段值我有一個包含使用SSRS

Fiscalmonthyear 
Fiscalmonthkey 

我有一個數據集FiscalYearMonth也Parameters!FiscalYearMonth.Value

我怎樣才能得到Fiscalmonthkey爲FiscalYearMonth參數?我嘗試了以下的表達,但沒有奏效

=lookup(Fields!FiscalMonthYear.Value,Parameters!FiscalYearMonth.Value, Fields!FiscalMonthKey.Value, "FiscalYearMonth") 

回答

0

我覺得你有你的函數參數順序錯誤,試試這個:

=lookup(Parameters!FiscalYearMonth.Value, Fields!FiscalMonthYear.Value, Fields!FiscalMonthKey.Value, "FiscalYearMonth") 

這bascially說:「數據集中‘FiscalYearMonth’,將參數!FiscalYearMonth.Value的值與數據集中每行的字段Fields!FiscalMonthYear.Value進行比較,並返回其中存在匹配項的Fields!FiscalMonthKey.Value的值。

請注意,Lookup()函數只返回一個值,並會在找到的第一個匹配處停止。