none
how to sort via multi value parameter in ssrs

    Question

  • I have a parameter with multi values. when the user selects ,he get of options like acount name, first name, last name.

    so if user selects firstname , the data has to sort by firstname.

    if he selects acount name , the data has to sort by account name.

    please help me how to sort the data using parameter with multivalue? in ssrs 2008.

    Thank you?

    Friday, March 22, 2013 9:35 PM

Answers

  • Hi Venku,

    Based on your description, it seems that you create a parameter with available values and you want to sort the report data based on the parameter value. If the available values are the field names in the report, you can try to open the Tablix properties dialog box and specify the sort expression on "Sorting" tab as follows:
    =Fields(Parameter!parametername.value).value

    If the parameter allow multiple values and you want to sort the report data by more than one field, for example, sort the report data by "accountname" and then by "firstname", please add two sort expressions as follows:
    =Fields(Parameter!parametername.value(0)).value
    =Fields(Parameter!parametername.value(1)).value

    If you have any question, please let me know.

    Regards,
    Fanny Liu


    Fanny Liu
    TechNet Community Support

    Monday, March 25, 2013 5:31 AM
    Moderator

All replies

  • Hi,

    You can use a case statement in your Stored procedure or TSql Query for sorting based on user selected parameter, this is the easiet way to achieve.

    Thanks,

    Fun BI

    Friday, March 22, 2013 9:54 PM
  • Hi Venku,

    Based on your description, it seems that you create a parameter with available values and you want to sort the report data based on the parameter value. If the available values are the field names in the report, you can try to open the Tablix properties dialog box and specify the sort expression on "Sorting" tab as follows:
    =Fields(Parameter!parametername.value).value

    If the parameter allow multiple values and you want to sort the report data by more than one field, for example, sort the report data by "accountname" and then by "firstname", please add two sort expressions as follows:
    =Fields(Parameter!parametername.value(0)).value
    =Fields(Parameter!parametername.value(1)).value

    If you have any question, please let me know.

    Regards,
    Fanny Liu


    Fanny Liu
    TechNet Community Support

    Monday, March 25, 2013 5:31 AM
    Moderator
  • What about in this case:  the multi value parm where you type in one or more purchase orders separated by comma as in (i.e. 4800, 4904, 4802).  My challenge is to get the report to sort on that specific order. for example, 4800 would render first, then 4904would render second b/c it was the 2nd value entered although its value is higher than 4802, and 4802 would be third?  You may ask yourselves "but why don't you just type em in numerical order"?  The answer is b/c the report owner, enters over 50 PO's a day from a stack that's not sorted, so she spends un needed time rearranging.

    Is this possible, if so, how?

    Regards,

    J.


    RS Newbie

    Wednesday, January 22, 2014 9:06 PM