0
votes

I have the following code and I now want to only show the max or distinct values for a single field within 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. I would like to only show the MAX or Distinct values of the AcctNbr on a single field within SSRS.

Is there a way to add the MAX expression to this existing expression?

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()."

Thanks.

1
Do you need to show the max or the distinct values?alejandro zuleta
Yes, I need the expression above to only show the max or distinct values.BIReportGuy
Why are you stuck? use Join(Code.RemoveDuplicates(LookUpSet(Fields!Baseacctnbr.Value, Fields!Baseacctnbr.Value, Fields!Acctnbr.Value, "DataSet1")),",") alejandro zuleta
@Hermanator you have a Close Brace ) after the first instance of Fields!BaseAcctNbr.Value hence your current errorJonnus
If you have found a resolution please consider posting it as an answer, so that this question does not show up as "unanswered" - thanks!Nathan Griffiths

1 Answers

0
votes

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.

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

Thanks for your help!