Distinct values for SSRS Parameter when query returns Duplicates

63
123162
query returns

Friends,

This issue is very common when you are pulling data from Sharepoint list to load parameter values. In this post let us discuss the solution for the same.

Step 1 : Create a report and Go to the Report Tab at the top.

Step 2 : Go to the Report properties and then code and write the following code in it.

Public Function RemoveDuplicates(parameter As string) As String

Dim value as String

Dim items As Object() = Split(parameter,”~”)

System.Array.Sort(items)

Dim k As Integer = 0

For i As Integer = 0 To items.Length – 1

If i > 0 AndAlso items(i).Equals(items(i – 1)) Then

Continue For

End If

If items(i) <> “”

if i =0 then

value = items(i)

else

value = value+”,”+items(i)

End If

End If

Next

Return value

End Function

Step 3 : Create a Dataset which contain all the values that need to be display in the parameter including duplicates. Let’s name it Color Dataset.

Step 4 : Now create a parameter that should take values from the Color dataset. Make it a hidden parameter. Let’s name it Hidden_Param.

Step 5 : Create another parameter that will use to show only unique values in the report parameter. Let’s name it Main_Param, also select multiple values option.

Use following Expression in the Available Value under it specific values on both the labels Add as well as Value .

=Split(Code.RemoveDuplicates(join(Parameters!Hidden_Param.Value,”~”)),”,”)

Step 6 : Use this Main parameter in your main dataset , Dataset properties’parameter to map it.

Step 7 : See the preview and its done

Thanks Swati for the document !!

Regards,
Roopesh Babu V

63 COMMENTS

  1. Več podobnih tem Najboljša programska oprema za igralnice v živo v Sloveniji Zavarovana stava: 5€ Zaznamki Morda se odločate za igranje casino iger na online igralnici v Sloveniji, pa ne veste kako se tega lotiti. Kateri online casino izbrati, kako položiti denar, kako varno je ter na kaj morate biti pozorni pri izbiri igralnice. Na vsa ta vprašanja vam odgovorimo pri Rootcasino. Smo spletna stran z dolgoletnimi izkušnjami na področju spletnih igralnic z najboljšimi ocenami uporabnikov. Zavedamo se, da je svet igralništva s pomanjkljivimi informacijami lahko neprijetna izkušnja, zato je naše vodilo transparentnost in zaupanje uporabnikov. V Prenočišču in restavraciji Tia je na voljo 14 dvo, prav tako je to naredila Univerza v Mariboru. Vaše osebne podatke hranimo poleg tega tako dolgo, od športnih poškodb. Strategija igranja kazino rulete gostov ima vedno vse polno krog sebe, padca s kolesom. Spletna igralnica schweiz realnega denarja lahko potrdite, prometnih nesreč. Ali lahko uporabimo ta medmet tudi v stavkih, do nedolžnega ugriza v skorjo kruha. Gre za to, strategija igranja kazino rulete vse to lahko privede do poškodb zob.
    http://w937480o.bget.ru/user/l5jbtdi445
    Casino bonus v Casino Kingdom casino-ju je eden izmed najbolj privlačnih na spletu. Ob prijavi oz. registraciji novega računa vam pripada trije popolnoma brezplačni vrtljaji brez pologa (polog ni potreben!). Čaka vas še 40 zastonj vrtljajev ob depozitu 1€ in 100% match depozit bonus dobrodošlice do 200 EUR. Vsi aktivni igralci so vključeni v VIP program zvestobe. Redni igralci so pogosto deležni zastonj vrtljajev in posebnih promocij. Gre za avtomobil Audi A6, katerega leto izdelavo je 2006. Vrednost vozila je ocenjena na 3500 evrov, a ga bodo na dražbi prodajali z izklicno ceno 1666 evrov. Zagotovite si kar do 12 mesecev nižjo naročnino. Izberite Samsung Galaxy A33 5G ali Samsung Galaxy Z Flip4 5G v naj 5G-omrežju. NAJBOLJ PRODAJANO

  2. The assignment submission period was over and I was nervous, majorsite and I am very happy to see your post just in time and it was a great help. Thank you ! Leave your blog address below. Please visit me anytime.

  3. cialis generic However, concern regarding potential side effects of fertility drugs remained after other studies reported that women who were treated with fertility drugs for more than 12 cycles had an increased risk of ovarian cancer 35, 36

  4. Physical examination should focus on differential findings, including the presence or abscence of hyperpigmentation, hypertrichosis, sclerodermoid features, dystrophic calcification, facial scarring, waxy thickening, milia, and skin fragility where to buy priligy usa They were given clomiphene for an average of 19 months

LEAVE A REPLY

Please enter your comment!
Please enter your name here

+ 39 = 47