简体   繁体   English

SSRS如何将Max表达式添加到现有表达式

[英]SSRS How to Add Max Expression to an Existing Expression

I have the following code and I now want to only show the max or distinct values for a single field within SSRS. 我有以下代码,现在我只想显示SSRS中单个字段的最大值或不同值。

=Join(LookUpSet(Fields!Baseacctnbr.Value, 
Fields!Baseacctnbr.Value, 
Fields!Acctnbr.Value, 
"DataSet1"), ",")

Right now with this expression the code brings back all the accounts, but it brings back multiples of the same account because of the SQL query and other data that is needed. 现在,使用此表达式,代码将带回所有帐户,但由于需要SQL查询和其他数据,因此带回了同一帐户的倍数。 I would like to only show the MAX or Distinct values of the AcctNbr on a single field within SSRS. 我只想在SSRS的单个字段上显示AcctNbr的MAX或Distinct值。

Is there a way to add the MAX expression to this existing expression? 有没有一种方法可以将MAX表达式添加到此现有表达式中?

UPDATE: When I add the SSRS Code Block found on another question, then I receive an error message that states: "Too many arguments to 'Public Shared Function RemoveDuplicates(m_Array() As Object) As String()." 更新:当我添加在另一个问题上找到的SSRS代码块时,我收到一条错误消息,内容为:“'Public Shared Function RemoveDuplicates(m_Array()As Object)as String()'的参数太多。”

Thanks. 谢谢。

I removed the close brace and it worked fine. 我拆下了大括号,它工作正常。 I had also entered this code before your response and it worked fine since the account is actually 8 characters long. 在您回复之前,我也输入了此代码,由于该帐户实际上是8个字符,因此效果很好。

=Join(Code.RemoveDuplicates(LookupSet(Left(Fields!BaseAcctNbr.Value, 8), Fields!BaseAcctNbr.Value, Fields!AllPhase3AcctNbrs.Value, "DataSet1")), ",")

Thanks for your help! 谢谢你的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM