4 Replies Latest reply on Feb 26, 2012 2:34 PM by Jonathan Drummey

    Conditional formatting multiple rows

    John Grant

      There was a long thread in 2011 titled " Conditional Formatting of Columns in Cross Tabs & Conditional Appearance of Marks" having to do with color (or shape) formatting rows/columns independently of one another.  Is version 7.0 any better equipped to do this?

        • 1. Re: Conditional formatting multiple rows
          Jonathan Drummey

          Not really, unfortunately. Please review the Ideas and vote some up!

           

          I put a bunch of the conditional formatting techniques together into one workbook here: http://community.tableau.com/thread/115822

           

          Jonathan

          • 2. Re: Conditional formatting multiple rows
            John Grant

            Excellent Jonathan, this should do the trick. Thanks

            • 3. Re: Conditional formatting multiple rows
              John Grant

              Jonathan...

               

              What did you do to get the column headings (Sales, Profit, Profit %, etc.) to show in the "Highlights" tab?

               

              Thanks,

              John

              • 4. Re: Conditional formatting multiple rows
                Jonathan Drummey

                On the "Start Here" worksheet on the workbook I linked to above there's a long caption with all the details on how to create the columns, here's the bit on the Text fields. Sometime in the next couple weeks I'll write up more detailed blog post with screenshots.

                 

                For the first three (text) columns:

                 

                Each column is a dual-axis in order to work around Tableau's default of showing the axis title on the bottom when there's only one axis. We create an "Empty Header" axis that goes on first, and then a second axis to actually draw the important text on. The marks for the Empty Header axis are ultimately made transparent and the axis title and tick marks removed.

                 

                Create calculated field "Empty Header" with value of 0.

                Create calculated field "One" with value of 1. Set the default aggregation for "One" to Average. (Using ATTR() as an aggregation makes formatting more difficult).

                Create calculated field "Red" = "Red"

                Create calculated field "Profit %" = SUM([Profit])/SUM([Sales])

                Create calculated field "Profit % Color" = IF [Profit %] > .3 THEN "High" ELSE "Low" END

                Drag Empty Header and One onto the Column shelf three times so they alternate Empty Header, One, Empty Header, One, etc.

                For each instance of Empty Header, change the Color of the mark to 0% Transparency, which effectively hides the mark.

                For each instance of One, set the mark type to text and put the desired measure on the Text shelf.

                For the instances of One that need color, drag a dimension/measure to the Color shelf (Manually setting the color on one mark card sets the color for all marks that don't have a pill on the Color shelf, so that method doesn't work when you want to color one column at a time).

                Set each instance of One to be dual axis.

                Set Format->Alignment->Sheet->Default->Pane alignment to Right so the text is a bit better aligned

                For each instance of One, turn off tick marks and relabel the axis according to the pill on the Text shelf.

                For each instance of Empty Header, edit the axis to turn off tick marks and delete the title to hide the axis.

                Finally, resizing the column width to look more reasonable.