6 Replies Latest reply on Sep 8, 2015 1:41 PM by erolst

    Condition Formatting

    Alasdair

      Hi

       

      I would like to change the background colour of a field based on specific text in another field.

       

      For example

       

      Field A has text in it "Full"

       

      Field B therefore has a red background, should field A change or be empty field B will return to its original background.

       

      Any help appreciated

       

      Regards

        • 1. Re: Condition Formatting
          erolst

          Alasdair wrote:

          Field A has text in it "Full"

          Field B therefore has a red background

           

          In the Conditional Formatting for fieldB, use the calculation PatternCount ( fieldA ; "Full" ) and set the desired formatting options.

          • 2. Re: Condition Formatting
            Alasdair

            Thanks

             

            This doesn't work for some reason as the calculation can't find the Field A even though it is in the list?

            • 3. Re: Condition Formatting
              Alasdair

              Thanks found it, Should be the other way round!

               

              PatternCount ( "Text" : Field A )

               

              Regards

              • 4. Re: Condition Formatting
                erolst

                Alasdair wrote:

                Thanks found it, Should be the other way round!

                 

                Actually, it should not – if you're really looking for a smaller sub-string in a larger text. Your order will only work if the field is identical to the search text, or is itself a sub-string of the search text.

                • 5. Re: Condition Formatting
                  Alasdair

                  Sorry I Don't understand, It simply doesn't work at all unless put the text first and the Field second.

                   

                  it's working? so hence my confusion.

                   

                  PS I don't know what a sub string is' or a larger text?

                  • 6. Re: Condition Formatting
                    erolst

                    A sub-string is a part of a text;

                     

                    PatternCount ( text ; subString ) can be True, because subString can be contained in text ; the reverse simply can never be true.


                    Consider


                    PatternCount ( "The little brown fox …" ; Table::colour )

                     

                    If records in “Table” contain “colour” values like red, blue, yellow or brown, then for some records the calculation will be true; but if you reverse the arguments:

                     

                    PatternCount ( Table:colour ; "The little brown fox …" )

                     

                    the calculation will never evaluate to True.