我有一个案例,我需要在另一个数据集中搜索固定数字(从 1 到 12 的月份 id)并返回返回字段的总和。
我使用的MultiLookUp
功能应该如下所示:
=code.SumLookup(Multilookup(Split("1,2,3,4,5,6,7,8,9,10,11,12" , ","),
Fields!Transaction_Month.Value,Fields!Total_O_S_Loss___LAE_Reserve.Value
, "DataSet3"))
SumLookUp
我以前用于的代码在哪里LookUpSet
,但它似乎不适用于MultiLookUp
Dim suma As Decimal = New Decimal()
Public Function SumLookup(ByVal items As Object()) As Decimal
If items Is Nothing Then
Return Nothing
End If
Dim ct as Integer = New Integer()
suma = 0
ct = 0
For Each item As Object In items
suma += Convert.ToDecimal(item) ct += 1
Next
If (ct = 0) Then
return 0
else return
suma
End Function
Public Function GetMyVal() as Decimal
GetMyVal = suma
End Function
你能提供一些建议如何执行这样的事情吗?
谢谢