Answered Sharepoint Choice Checkbox count

  • lunedì 13 agosto 2012 08:35
     
     

    I have a list with a choice field and checkboxes to allow multiple selections. I want to have a new column which will show as a number how many choices were selected. For example:

    Choice 1

    Choice 2

    Choice 3

    Row 1 has Choice 1 and Choice 2 selected = 2

    Row 2 has Choice 3 selected = 1

    Row 3 has Choice 1, Choice 2 and Choice 3 selected =3

    Thanks in advance for your help!

Tutte le risposte

  • martedì 14 agosto 2012 05:26
    Moderatore
     
     

    Hi ,

    I understand that you want to count how many items have been selected in a multiple selection list box. You can customize the form in InfoPath designer to achieve this. Here are two options.

    1. You can create a single line of text column in browser to hold the sum number. Set the default value for the single line of text column as :concat(“the selected choices count is :”,count(Value)).(this value is the multiple selection list box value, you should insert it using ‘Insert Field or Group ’ button)
    2. You can also add a calculated value on the form to hold the value concat(‘the selected choices count is :’,count(Value)).

    If you want to get all the options checked in the multiple selection list box, there is not such a good way in InfoPath designer. It will only return the first selection. You can use SharePoint designer workflow to get all the selections in the multiple selection list box.

    Thanks,

    Entan Ming


    Entan Ming

    TechNet Community Support

  • martedì 14 agosto 2012 08:51
     
     

    Hi,

    Thanks for the reply. However, I do not have infopath. I am using SharePoint Designer to modify the dataview.

    I have inserted a new column and have inserted your formula as: concat(count(Value)) however SPD is saying that there are an invalid number of arguments.

    Is there a way that this can be achived in SPD?

    Thanks,

  • mercoledì 15 agosto 2012 03:14
    Moderatore
     
     Con risposta

    Hi ,

    I understand that you want to calculate how many choices have been selected in a multiple selection column in SharePoint designer.I have a workaround:the choices selected will be separated with comma.You can use a formula to remove the comma and then compare to the orignal string.Edit a column formula in the view to hold the choices number.

    The formula is like this :concat('you have selected ',string-length($thisNode/@choicessss)-string-length(translate($thisNode/@choicessss,',',''))+1,' choices')" />

    This formula will calculate the correct selection only when all the items have values in that choicessss column(choicessss is my multiple selection column ,you need to change it to your column name).

    Thanks,

    Entan Ming


    Entan Ming

    TechNet Community Support

    • Contrassegnato come risposta ZxIRAX lunedì 20 agosto 2012 08:30
    •  
  • mercoledì 15 agosto 2012 08:25
     
     

    Hi,

    Perfect - I needed to modify the formula slightly but it worked perfectly.

    Thank you for your help!

  • giovedì 16 agosto 2012 16:28
     
     
    Is it possible to perform the same calculation in list? For example, if I create a new calculated column, is there a calculation I can use to generate the number of options selected?
  • venerdì 17 agosto 2012 10:03
    Moderatore
     
     

    Hi ,

    We cannot get the same caluclation in list. The multiple selection list box cannot be used in a calculated formula. And there is no such a formula to count the number of choices in the multiple selection list box.

    Thanks,

    Entan Ming


    Entan Ming

    TechNet Community Support



  • mercoledì 6 febbraio 2013 18:57
     
     

    Hi. I'm trying to achieve similar results. What did you do to modify the formula to get it to work?

    Thanks for any help!

    :)


    • Modificato j_walsh mercoledì 6 febbraio 2013 18:57
    •