Change text depending on number of parameters
-
Friday, March 22, 2013 12:27 PM
Hello,
I have a report where I write the name of the sales person above the data table depending on what sales district i pick as a parameter. It is also allowed to pick more than one district, but when that happens, the report will always show the name of the sales person for the first district, but the data in the table will show for all the sales districts that have been choosen.
Now, I would like my report to not display anything in the name field if the parameter contains more than one district. How can I do that?
All Replies
-
Friday, March 22, 2013 12:37 PM
Hello Andreas,
You can use the Count() function of the parameter to get the count of selected parameter value; so in an expression you can return the name or an empty string depending on this value:
=Parameters!ReportParameter1.Count()
Olaf Helper
Blog Xing- Edited by Olaf HelperMicrosoft Community Contributor Friday, March 22, 2013 12:37 PM
- Marked As Answer by SPEHE Friday, March 22, 2013 12:58 PM
-
Friday, March 22, 2013 12:55 PM
Hi,
i guess you have a Multi Value Parameter. To get the String value of a Multi Value Parameter you need to join the Values:
Example: Your Parameter hast the values
0: "Mary"
1: "Alex"
2: "John"Use: Join(Parameter!P1.Value, ", ") and you will get: "Mary, Alex, John" in your Field
Hope this helps.
-
Friday, March 22, 2013 1:01 PM
Hello both Sven and Olaf and thank you for your help. I tried Olafs suggestion and it worked exactely as I wanted. Then I read Svens answer and changed my qery accordingly and that worked also. In the end I went for Olafs solution.
Thanks again.
//Peter

