7 Replies Latest reply on Mar 15, 2016 5:52 PM by Chale Dodge

    Conditional Formatting

    Barb Reiser

      Hello,

       

      How do I only format columns "Didn't Meet" and "Needs Help" for those values greater than 20%?

       

      Thank you

      Barb

        • 1. Re: Conditional Formatting
          Kalyan Allam

          Hi Please find the attached twbx file with the solution.

           

          Most of the times when you want to do the conditional formatting , its always easier to write a calculated field. I wrote two calculated fields.

           

          One is for your table calculation.

           

          And another one to give a condition as you required for the formatting.

           

          Tell me if you need anymore clarification.

          • 2. Re: Conditional Formatting
            Chale Dodge

            Hi Barb/Kalyan,

             

            You can actually do it in 1 go.

             

            If you create the calculated field like this:

             

            IF ATTR([Pivot field values]) = "Didn't Meet" AND (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])) >= 0.2) then "Didn't"

            ELSEIF ATTR([Pivot field values]) = "Needs Help" AND (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])) >= 0.2) then "Help"

            ELSE "No Problem"

            END

             

            Also set the Table Calculation - Compute Using as Table (Across).

             

            Hope that helps?

             

            Regards

            Chale

            • 3. Re: Conditional Formatting
              Barb Reiser

              That's awesome! What if I wanted to have 2 formats, is there a way to combine them?

               

              IF [Value] > .75 THEN

                  IF MAX([Compentency Value]) = "Exceeds" OR MAX([Compentency Value]) = "Meets" THEN
                  1
                  ELSE
                  0
                  END

               

              ELSE

              0

               

              END

               

              IF [Value] > .10 THEN

                  IF MAX([Compentency Value]) = "Needs Help" OR MAX([Compentency Value]) = "Didn't Meet" THEN
                  1
                  ELSE
                  0
                  END

               

              ELSE

              0

               

              END

              • 4. Re: Conditional Formatting
                Chale Dodge

                Hi Barb,

                 

                Apologies for the delay on my response above - I was sitting in a moderation queue. Now I am out

                 

                Does the above calculation give you what you are after?

                 

                By the way, you may want to log another request to get a better response - as you are asking another question

                 

                Also I notice that a number of your posts have been heading in a certain direction to convert the same data. Are there any more steps that you are looking to complete or any other data queries you have at the moment? Feel free to post them all up with different posts or if you ask for your end goal - you could get an explanation with all of the steps to get there in 1 go.

                 

                Regards

                Chale

                • 5. Re: Conditional Formatting
                  Barb Reiser

                  Hi Chale,

                   

                  Sorry for the delay in responding. I had a really busy day today.

                   

                  Thank you for the feedback. I'll post a separate question. I couldn't get the formula to work as I wanted. I'll have it in there when I repost. I'm just doing some ad hoc reporting. I don't necessarily have a plan in place. I kind of decide what I want to do as I go.

                   

                  Thanks for the help,

                  Barb

                  • 6. Re: Conditional Formatting
                    Barb Reiser

                    Chale,

                     

                    Guess what? I just tried it again and it's working now. I must not have done something right when I tried it before. I used:

                     

                    IF ATTR([Pivot field values]) = "Didn't Meet" AND (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])) >= 0.20) then "Didn't Meet"

                    ELSEIF ATTR([Pivot field values]) = "Needs Help" AND (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])) >= 0.20) then "Needs Help"

                    ELSEIF ATTR([Pivot field values]) = "Exceeds" AND (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])) >= 0.50) then "Exceeds"

                    ELSEIF ATTR([Pivot field values]) = "Meets" AND (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])) >= 0.50) then "Meets"

                    ELSE "No Issue"

                    END

                     

                    Thanks again!

                    Barb

                    • 7. Re: Conditional Formatting
                      Chale Dodge

                      Nice work Barb! You get all the credit for that - nice work on your first calculation!

                       

                      By the way in case you look at this thread in future and need an explanation - or someone does.

                       

                      I will explain these 2 items:

                      ATTR([Pivot field values])

                      This is actually so that the calculation can work. If you take out ATTR Tableau will complain you can't compare Aggregate and Non-Aggregate.

                       

                      There is a good explanation here:

                      Attribute?

                       

                      (COUNT([Pivot field values]) / TOTAL(COUNT([Pivot field values])

                      This is the Table Calculation for Percent of Total.

                       

                      There is a good explanation here:

                      Turn a Quick Table Calculation into a Calculated Field | Tableau Software

                       

                      Hope that was useful! Happy Tableau-ing Barb!

                       

                      Regards

                      Chale