none
multiple values in parameters selected in SSRS

    Question

  • Hello , I have a multi valued parameter. I want to get max and min of the value. the parameter available values are coming from SSAS though..

    i am was able to display the first value by using =Parameters!Date.Label(0) but how to get the last value.. because the maximum.. i dont know how many values i have selected..  Please advise.

     

    thanks

    Madhavi

    Wednesday, April 06, 2011 4:08 PM

Answers

  • Hey Madhavi,

    When you say MIN and MAX, do you refer to the first and last values of your multi valued parameter?

    Lets proceed with that understanding:

    For the first value, good that you got it working; you are doing it right.

    For the Last value, here is what you can do:

    =Parameters!Date.Label.GetValue(Parameters!Date.Count - 1).ToString
     

    Since any multi-valued parameter is an array, you can use the GetValue Method to fetch the value at the index of "Count - 1" (which is nothing but your last value; remember that the arrary is 0 indexed).

    Note: The GetValue method might not show up in your IntelliSense and might get underlined in your Expression Editor as an error; just dont worry, go ahead and try it.

    HTH.


    Please mark correct answers :)
    Wednesday, April 06, 2011 7:14 PM

All replies

  • I think you can create a separate dataset (add new dataset) and write a query to get those values first then select parameter values from that dataset..
    Wednesday, April 06, 2011 5:35 PM
  • Hey Madhavi,

    When you say MIN and MAX, do you refer to the first and last values of your multi valued parameter?

    Lets proceed with that understanding:

    For the first value, good that you got it working; you are doing it right.

    For the Last value, here is what you can do:

    =Parameters!Date.Label.GetValue(Parameters!Date.Count - 1).ToString
     

    Since any multi-valued parameter is an array, you can use the GetValue Method to fetch the value at the index of "Count - 1" (which is nothing but your last value; remember that the arrary is 0 indexed).

    Note: The GetValue method might not show up in your IntelliSense and might get underlined in your Expression Editor as an error; just dont worry, go ahead and try it.

    HTH.


    Please mark correct answers :)
    Wednesday, April 06, 2011 7:14 PM
  • hello,

    Thank you very much for ur valuable help.

    What i did was i created a parameter cnt and set it as parameters!date.count-1. then i used it in the place of 0 in label(0).

    i think went round about. I dont see the methods in the expression builder. Where can i find the list of methods that can be used on parameters and fields in SSRS. is it in the microsoft library.

     

    Please let me know

    thanks would be very helpful..

     

    Wednesday, April 06, 2011 7:32 PM