3 Replies Latest reply on Dec 1, 2011 10:07 AM by TravisMolleck

    ValueCount manipulation

    TravisMolleck

      Title

      ValueCount manipulation

      Post

      I have a field that counts the number of checks in a checkbox field. is there a way for me to have a one specific check worth more than others? for example, I would love for one value to be labeled "All" and it's value be equal to the all the checkboxes available (it wouldn't matter if this was set statically or dynamically as the total checkboxes availble aren't going to change often)

        • 1. Re: ValueCount manipulation
          philmodjunk

          IF ( Filtervalues ( checkboxfield ; "All" ) = "All" ; //put count of all possible values here ; valuecount ( checkboxfield ) )

          You might also remove "all" from your value list and replace it with a button. Then your button could use this script step to select all the checkboxes with one click and then your valuecount works without modification:

          Set Field [Yourtable::checkboxfield ; ValuelistItems ( Get ( Filename ) ; "valuelistnameInQuotes" ) ]

          • 2. Re: ValueCount manipulation
            raybaudi

             Try:

            Case(
            ValueCount ( FilterValues ( CheckBox ; "All" ) ) ; ValueCount ( ValueListItems ( Get ( FileName ) ; "nameOfYourValueListInQuotes" ) ) ;
            ValueCount ( CheckBox )
            )

            • 3. Re: ValueCount manipulation
              TravisMolleck

              Raybaudi: This does exactly what I was looking for thank you very much.

               

              for future readers, I had to add in a -1 to compensate for the "all" choice, so it ended up looking like:

               

              Case(
              ValueCount ( FilterValues ( CheckBox ; "All" ) ) ; ValueCount ( ValueListItems ( Get ( FileName ) ; "nameOfYourValueListInQuotes" ) )-1 ;
              ValueCount ( CheckBox )
              )