Home Forums Reporting Services SSRS 2012 How can i solve the error: 'An expression of no-boolean type.... RE: How can i solve the error: 'An expression of no-boolean type....

  • I may be mistaken on this, but I think that the problem is that @Dimension is not containing a single int value.  You say that it is multiple selects.  So I am expecting that @Dimension is going to return an array like structure.
    So as soon as more than 1 value is selected, you end up with @Dimension being something like (1, 2, 3).  So when you have "IF @Dimension = 2", you are saying "IF (1, 2, 3)  = 2".
    If you are wanting to check if @Dimension contains 2, you would likely get better results by using "IF 2 IN (@Dimension)".  If you are wanting to know if @Dimension equals 2, you will likely want to store the value into a separate string variable and do your comparison that way.  Depending on how many selections you ahve in @Dimension, you may want to turn the selection list into a comma separated list and store that for doing the comparison (using =JOIN).

    Now, I could be misunderstanding what you are asking, but I think the problem is due to @Dimension containing multiple values and that it works as expected with a single value for @Dimension.  Ist that correct?

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.