4 Replies Latest reply on Feb 17, 2014 2:42 AM by soumya gowda

    Tweaking the tips of data points in a time series line graph

    Thomas Ball

      Hi-

           I have a time series for which I have created 95% cconfidence intervals.  The bands are tight, however, aand when all 3 series are plotted together, it's kind of an overlapping mess.  There was a thread recently which showed how to highlight the bars of specific data points in a line based on the column values.  My interest is a little different...ideally, I would like to highlight those lines that break through the confidence bands beginning at the value set by the confidence interval.  Here's an example:

                    Series

      Week     Value     Upper CI

        56        5,132       5,233

        57        4,855       4,731

       

      In week 56, the series did not break through the upper CI of 5,233.  But in week 57 the series does break through the upper CI of 4,731 by 4,855.  In an ideal world, it would be possible to shade or highlight the time series bar for this data point from 4,731 to 4,855 denoting that the upper CI had been breached by 124 units without graphing the entire CI time series.

       

      I recognize that this may be an impossible goal.  Short of tweaking the tips of a data point, and switching to a line graph style that represents the ends of a data point with a dot, can the end dots be colored differently to capture the fact that the CI has been breached?  In other words if the body of the line graph is blue can the end dot be colored red if the lower CI is breached and green if the upper CI is breached?  That seems like a little more reasonable request.

       

      I hope this is clear.  Thank you in advance.

       

      Tom

        • 1. Re: Tweaking the tips of data points in a time series line graph
          Jim Wahl

          Hi Tom,

           

          Welcome to the forums. You'll quickly find that very few things are impossible in Tableau, and the community is very good at finding creative solutions.

           

          In your case, the solution might be relatively easy. Just create two calculated fields,

          1. # members at or below the upper CI
          2. # members above upper CI

          Add these as "measure values" to create a stacked bar chart. Add the measure names to the color shelf. I also added the individual measures to the level of detail shelf to use the values in the tool tip text.

          CI_1.png

           

          You could also do a more traditional bar-chart type CI with dual-axis by using a dual-axis chart to combine a bar chart with a Gantt chart for the CI.

          CI_2.png

           

          See that attached twbx. And shout if the above steps aren't detailed enough or this isn't quite what you were looking for. ...

           

          Jim

          1 of 1 people found this helpful
          • 2. Re: Tweaking the tips of data points in a time series line graph
            Thomas Ball

            Hi Jim-

                 Many thanks for taking the time to think about my question.  I'm afraid that I miscommunicated and oversimplified the question by neglecting to mention that I also have a lower conf interval and was interested in tinging the tips of a line graph.  So a vertical bar chart wouldn't quite work where a line graph would. 

                 Given that, what about a stock ticker type presentation?  Tinging something like that could potentially work.

            Thank you again,

            Tom

            • 3. Re: Tweaking the tips of data points in a time series line graph
              Jim Wahl

              Yes, you can "tinge" the line as it goes above or below a the CI. Or do many variations.

               

              Start by creating a field to control the color: Count outside of CI =

              IF SUM([# Members]) < SUM([LowerCI]) THEN "Below Lower CI"

              ELSEIF SUM([# Members]) > SUM([UpperCI]) THEN "Above Upper CI"

              ELSE "Within CI" END

               

              Now you can add this to the color shelf to color the lines or dots.

               

              You could also do a line chart with vertical bars showing the CI. Or, my favorite, replace the line with dots.

               

              See attached twbx. ...

              1 of 1 people found this helpful
              • 4. Re: Tweaking the tips of data points in a time series line graph
                soumya gowda

                Hi Jim Wahl,


                How to show values on data Points on line chart ??

                 

                Thanks in advance,

                Soumya