Passing multiple values to a Parameter

  • I am attempting to use one Parameter for multiple uses in a SSRS report and I am having some issues. It works fine when I just pass one value to the query using IN @Parameter. However, I have a SUM that would need to pass all the possible values to this Parameter and I cannot seem to get it to work. I have checked Allow Multiple Values for the Parameter. On the Jump To properties, how can I pass the specific multiple values that I need? Or, can I somehow get the query to ignore the need for the Parameter when I am clicking on the SUM field?

  • cliff.clayman (12/13/2013)


    I am attempting to use one Parameter for multiple uses in a SSRS report and I am having some issues. It works fine when I just pass one value to the query using IN @Parameter. However, I have a SUM that would need to pass all the possible values to this Parameter and I cannot seem to get it to work. I have checked Allow Multiple Values for the Parameter. On the Jump To properties, how can I pass the specific multiple values that I need? Or, can I somehow get the query to ignore the need for the Parameter when I am clicking on the SUM field?

    I assume you mean you are passing a delimited string? You can't use IN like that with a parameter. You first have to parse the value. One of the best ways to do that is found by following the link in my signature about splitting strings.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Yes, the values are varchar. The basic issue I am facing is this. I have a group of values, let's say A, B and C. For each value, I calculate a quantity and then a SUM of the quantity for all the values. I want to be able to do a Jump To for the same report when I click on the total SUM. I somehow need to pass the values for A, B and C to the report.

    I don't see how I can apply anything from that link to my issue. Sorry, I'm still pretty new to this...

  • Have you tried creating a parameter which takes in A,B,C as value and another parameter which depends on the first dataset for operations to perform .

    Read cascading parameter :- http://msdn.microsoft.com/en-us/library/dd255197.aspx

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply