5 Replies Latest reply on Feb 13, 2013 11:02 AM by . Berrett.Rice

    highlight data points based on column value

    . Berrett.Rice

      I have three columns of data. (1) is a date. (2) is a value from 1-10 which represents a rating by an end user on a scale that is filled out once each day. And (3) is a Y/N column that simply indicates whether or not a certain even took place on that day or not.

       

      I want to make a line graph and I want the data points to be one color (e.g., blue) if column 3 is "N" and another color (e.g., red) if column 3 is "Y".

       

      So this is basically a conditional formatting type question. Can this be done?

        • 1. Re: highlight data points based on column value
          Joshua Milligan

          Berrett,

           

          I think there are quite a few options.  Take a look at the attached workbook and see if either approach is what you are looking for.  If so, and you still have questions, I'd be happy to answer!

           

          Joshua

           

          colored lines 2.png

          colored lines.png

          1 of 1 people found this helpful
          • 2. Re: highlight data points based on column value
            . Berrett.Rice

            Yes! The first one (with the data points highlighted) is exactly what I want to do? Can you tell me how you did it?

            • 3. Re: highlight data points based on column value
              Joshua Milligan

              Berrett,

               

              Certainly!

               

              It is a dual axis chart, which means that there are two of the same axes that are shown together (2 X axes or 2 Y axes).  You can think of them as creating layers of marks.  This is an incredible feature in Tableau and allows for a lot of flexibility in creating combo-chart visualizations.  In this case, I combined a line and circles.

               

              Here are the steps I took:

              1. Add Date to Columns.  Then I right clicked it and switched it to be "Exact Date" and "Continuous".  This created a continuous date axis.

               

              2. Add Value to Rows to create one Y axis.

               

              3. Add Value to Rows again, to create the second Y axis.

               

              At this point, you should have two line charts like this:

              two axes.png

              4. You can overlay the two by creating a dual axis.  There are a couple of ways to do it.  You can right click the second Value field on the Rows shelf or right click the second "Value" axis in the viz. (I've highlighted both options above).  Select "Dual Axis".

               

              5. At this point, you'll have a dual axis and Tableau has tried to be helpful by adding "Measure Names" to the Color and FIlter shelves.  You can drag those to fields off.  We won't need them for this.

               

              6. You'll want to specify multiple mark types.  Right click the second Value field in the Rows and select Mark Type and select Circle. 

               

              (For future reference, you can also get multiple mark types using the little drop down arrow on the Marks card).

              multiple mark types.png

              7.  At this point you can drag your Y/N field to the color shelf and you are done!

               

              You can switch which axis you are working with by using the arrow buttons. This what will allow you to customize the marks for the different axis and overlay different types of charts.  (e.g. a line chart on top of a bar chart)

              multiple mark types 2.png

               

              Best Regards,

              Joshua

              1 of 1 people found this helpful
              • 4. Re: highlight data points based on column value
                Joshua Milligan

                By the way, Berrett, I absolutely agree that the first picture is a better chart than the second for this data.  The value is either Y or N -- very discrete, so the color should also be discrete and not the gradient seen in the second image.

                • 5. Re: highlight data points based on column value
                  . Berrett.Rice

                  This is awesome! Thank you so much for your generous help. I really appreciate it. It worked beautifully.