Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

SSRS expression switch/Else if

Asked by Ira Joshi May 17, 2021 1.2K views 1 answer
Share

About this question

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

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.