5 Replies Latest reply on Mar 15, 2017 12:03 PM by m jk

    count using contains

    m jk

      hi

       

       

       

       

      10.1 version

       

      need help in count using contain, missing something simple here ?

        • 1. Re: count using contains
          Tom W

          You're trying to count the number of names which contain those keywords?

          If so, you should be using something like:

           

          COUNT(IF CONTAINS([Name],"ALL") or CONTAINS([Name],"HIL") or CONTAINS([Name],"CAL") then [Month] END)

           

          That will count the number of month records with corresponding names matching those conditions.

          • 2. Re: count using contains
            m jk

             

            it should be like for month 1 ,HIL COUNT SHOULD BE 5 AND SO ON..

             

            but this formula is giving total count

             

            { FIXED [Month] :COUNT(IF CONTAINS([Name],"ALL") or CONTAINS([Name],"HIL")

            or CONTAINS([Name],"CAL") then [Month] END )}

             

             

            OR

             

            SOMETHING LIKE THIS ?

             

            if {fixed [Month]:Min(CONTAINS([Name],"CAL"))}and

            {fixed [Month]:Min(CONTAINS([Name],"HIL"))} THEN COUNT([Name]) ELSE 0 END

             

             

            like here 1 month should have cal as 3 and hil  as 5 ..?

            • 3. Re: count using contains
              m jk

              Tom W

              Shinichiro Murakami

               

              can you help here?

              • 4. Re: count using contains
                Tom W

                You're not very clear in your description of what the result should be.

                Do you want a combined count of HIL, CAL and and ALL or do you want one field for each one?

                 

                If you just want a count of the number of names which match HIL, create a field like;

                COUNT(IF CONTAINS([Name],"HIL") THEN [Name] END)

                 

                Then create another field but substitute HIL for CAL.

                 

                This would be the end result:

                 

                 

                Is this what you're after?

                • 5. Re: count using contains
                  m jk

                  thankyou for replying got it