9 Replies Latest reply on Jun 15, 2013 6:36 AM by . Berrett.Rice

    Draw reference line - but with a Dimension variable

    . Berrett.Rice

      I have a horizontal axis with a text dimension in it. See attached. I need to draw a vertical line that separates 2010-2011 and 2011-2012. This would be exactly like a reference line -- but I don't have the option of using a reference line because the labels are Dimensions. For the life of me I can't figure out a way to do this.

       

      Also, FYI, I would settle for just drawing the line manually if there's a way to do that.

       

      Thank you!

       

      Screen shot 2013-06-14 at 11.28.31 AM.png

        • 1. Re: Draw reference line - but with a Dimension variable
          . Berrett.Rice

          ... Also, any way to make the distinction between those years would be acceptable (e.g., a different shading of those columns, or whatever).

          • 2. Re: Draw reference line - but with a Dimension variable
            cory.tak.0

            Can you attach a workbook that I can experiment with?

            • 3. Re: Draw reference line - but with a Dimension variable
              Shawn Wallwork

              Cory, welcome to the forums! Especially considering you posted this:

              Can you attach a workbook that I can experiment with?

               

              This is the #1 response on these forums (well this and similar ones). Since you've demo'd a willingness to post these sorts of responses, please allow me to point out a few of the finer points of asking for workbooks:

               

              • Always include the word "packaged" before workbook
              • Best to include the term "packaged (twbx)" so you head off that round of exchanges
              • Good to include the word "sample", vaguely indicating we don't need (or want) all their sensitive data
              • "Superstore Dataset" is another good one to work in if you want to derail the sensitive data protest/exchange
              • "Expected" results is something Joe Mako always asks for (and I almost always forget to mention, and suffer the consequences)
              • Turns out there really isn't an "I" in the forums (hyperbola), which is another one I often forget; "...that we can experiment..." is better. [Because trust me, when someone posts a good packaged workbook to noodle, it will most definitely turn into a "we" answer.]

               

              If you come up with the perfect (concise) way to state this in crystal-clear terms Joe and I (and many others) will lobby (demand!) it be added to the response ribbon of icons, along with a few others:

               

              Respones Button.png

               

              I considered ping everyone who has ever complained about this issue, but the list is too long. If we can't get notifications back, having an autoresponse icon would be my second most important want/time-saver.

               

              Cheers,

               

              --Shawn

              • 4. Re: Re: Draw reference line - but with a Dimension variable
                . Berrett.Rice

                Here's a packaged workbook with sample data in it. I want to draw a vertical line between 2010-2011 and 2011-2012.

                • 5. Re: Re: Re: Draw reference line - but with a Dimension variable
                  cory.tak.0

                  Hey Berrett,

                   

                  This is the best we could think of.  We created different groups for the years (right-click and select group). We then named the groups appropriately.

                   

                  Another solution was that we created a calculated field that created an arbitrary score of 100 for the year 2010-2011. We then adjusted the size to be as small as possible and used a dual axis. This solution is not ideal nor is it very scalable. (You probably want that line to be farther to the right).

                   

                  If it's at all possible, I would use dates in their traditional format.

                   

                  If you're sold on the two year date bins there's a great article here:

                  Using Custom Date Levels | Tableau Software


                  Shawn, thanks for the heads up. I will keep your post in mind as I make future posts.


                   

                  1 of 1 people found this helpful
                  • 6. Re: Draw reference line - but with a Dimension variable
                    Shawn Wallwork

                    Hey Cory, the other thing I forgot to mention is to ask what version of Tableau they are working in.It looks like you posted a V8 workbook, but the workbook they posted is V7. Their next post will be about not being able to open your workbook. [Helping other people on the Tableau forums isn't as easy as it look!] BTW, you're solution and explanation were right on. Especially this:

                     

                    If it's at all possible, I would use dates in their traditional format.

                     

                    Given the string format of the Year field, here's the formula to convert it to a real date:

                     

                    DATE( "1/1/" + STR(LEFT([Year],4)))

                     

                    Cheers,

                     

                    --Shawn

                    • 7. Re: Re: Re: Draw reference line - but with a Dimension variable
                      Joe Mako

                      Attached is another option (in v7) that shades the area, using a calc field:

                       

                      CASE [Year]

                      WHEN "2008-2009" THEN 0

                      WHEN "2009-2010" THEN 0

                      WHEN "2010-2011" THEN 0

                      END

                       

                      and a reference line:

                      ref line config.png

                       

                      I added another reference line for the label.

                       

                      Also to add clarity to your original question, I would rephrase it as:

                      "I have a discrete pill on the Columns shelf. See attached. I need to draw a vertical line that separates 2010-2011 and 2011-2012. This would be exactly like a reference line -- but I don't have the option of using a reference line because the columns are discrete."

                       

                      The pill on your columns shelf is a discrete dimension, being a discrete pill is what is creating a the cells, one for each distinct value. A continuous pill would create a continuous axis, enabling normal reference lines.

                       

                      Awareness of the 4 Pill Types in Tableau is a foundation that enables us to use VizQL. Without this awareness, many things in TAbleau will seem unpredictable and frustrating.

                       

                      Here is a quick intro:

                       

                      We have 4 pill types in Tableau, 4 because there are 2 binary options:

                      Dimension or Measure

                      and

                      Discrete or Continuous

                       

                      so we have:

                      - Discrete Dimension

                      - Discrete Measure

                      - Continuous Dimension

                      - Continuous Measure

                       

                      Most pills are either:

                      - Discrete Dimension

                      or

                      - Continuous Measure


                       

                      Looking at the color of the pill does not tell you if it is a Dimension or a Measure, the pill color tells you if it is Discrete or Continuous.

                       

                      Pill color (Discrete vs Continuous) the visual and interface, and being a Dimension or Measure is much more substantial.

                       

                      Discrete pills on the Columns and Rows shelves give us Cells and Panes, while a Continuous pill will give us an Axis.

                       

                      Discrete or Continuous give us different Filter dialogs and controls, and different Color Legends.

                       

                      Dimension pills set our level of detail, and in my opinion are the most import pill type to have awareness of, especially when dealing for more advanced computations.

                       

                      Measure pills are aggregations that roll underlying data up to the level of detail.

                      • 8. Re: Re: Re: Re: Draw reference line - but with a Dimension variable
                        Jonathan Drummey

                        That's a great trick, Joe!

                         

                        Another option for the line is to use a Point Annotation with a single edge border:

                         

                        Screen Shot 2013-06-15 at 7.52.09 AM.PNG.png

                         

                        Screen Shot 2013-06-15 at 7.51.20 AM.PNG.png

                         

                        The length of the line (and position of any text, though no text is required) is controlled by using linefeeds in the annotation:

                        Screen Shot 2013-06-15 at 8.03.10 AM.PNG.png

                         

                        This is set up in the attached v7 workbook, along with Cory's solution.

                         

                        Jonathan

                        1 of 1 people found this helpful
                        • 9. Re: Re: Re: Re: Draw reference line - but with a Dimension variable
                          . Berrett.Rice

                          Thanks so much for the amazing responses. You were correct that I couldn't open the original V8 workbook, but the other responses exceeded my needs. Joe Mako - yours is fantastic and will end up being the one that I will use. Thanks.

                           

                          I appreciate the feedback on correct terminology too. That will help if I post again in the futre. Thanks to this great community. My presentation next week is saved!