Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I have been messing around with this all morning and i just can't quite figure it out. A Parameter is with me that can be one of two values. Either I or P.

So i want the title on the report to say one thing when I is chosen, one thing when P is chosen, and one thing when both are chosen (this is a multi select parameter)

I am currently having this but it keeps coming up with #Error.

=Switch(Parameters!clmType.Value = "P","List of Professional Paper Claims ", Parameters!clmType.Value = "I","List of Institutional Paper Claims ", Parameters!clmType.Count > 1 ,"List of Professional & Institutional Paper Claims ")

I've also tried this

=Switch(Parameters!clmType.Value = "P","List of Professional Paper Claims ", Parameters!clmType.Value = "I","List of Institutional Paper Claims ", Parameters!clmType.Value = "P" and Parameters!clmType.Value = "I" ,"List of Professional & Institutional Paper Claims ")

Also used a nested IIF. But i am not sure that what would it look like, or the order of it.

I also have tried using this as a Nested IIF and still getting a #Error

=IIF(Parameters!clmType.Count > 1,"List of Professional & Institutional Paper Claims ", IIF(Parameters!clmType.Value = "P","List of Professional Paper Claims ","List of Institutional Paper Claims "))

So i know that it partially works because i have used this and it worked as expected

=IIF(Parameters!clmType.Count > 1,"List of Professional & Institutional Paper Claims ", "only one picked")

1 Answer

0 votes
by (47.2k points)

Syntax for case statement in SSRS:

Switch(Expression as Object)

Syntax for IIF() statement in SSRS:

=IIF( Expression to evaluate,

         what-to-do when the expression is true,

         what-to-do when the expression is false )

Try to implement this variation of your first expression:

=Switch(Parameters!clmType.Value = "P","List of Professional Paper Claims ", Parameters!clmType.Value = "I","List of Institutional Paper Claims ", True,"List of Professional & Institutional Paper Claims ")

Check out ssrs tutorial that helps you to gain much more knowledge. 

Related questions

0 votes
1 answer
asked Feb 4, 2020 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
asked Jan 31, 2020 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
asked Jan 31, 2020 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
asked Feb 27, 2020 in BI by Vaibhav Ameta (17.6k points)

Browse Categories

...