3 Replies Latest reply on Apr 30, 2017 5:49 PM by Jinesh Mehta

    Vertical line plot

    Lokesh Gupta

      hi guys

       

      i have plotted hourly count (hour is stored in a dimension) of a variable. I need to insert a line on hour dimension axis when the count of variable reaches or crosses the 98 percent of total count.how can i achieve that in tableau.

       

       

      Variablehour
      Any Value1
      Any Value1
      Any Value1
      Any Value2
      Any Value2
      Any Value2
      Any Value3
      Any Value3

       

       

      my plot is hour v/s count(Variable) as shown in the table. I need the vertical line on hour dimension axis when count crosses 98 percent of the total count.Please suggest how to do that.

        • 1. Re: Vertical line plot
          Jinesh Mehta

          Is the attached screenshot on the lines of what you wish to achieve?

           

          Thanks!

          • 2. Re: Vertical line plot
            Lokesh Gupta

            Hi Jinesh,

             

            Thanks for putting your time and effort in solving my problem.

             

            Although what i wish to to achieve is a bit different.

             

            first of all i don't want to plot running total of of the counts. I want to plot the hour v/s count of variable.

             

            Secondly i want the 98 %ile line perpendicular to hour dimension axis.

             

            in your screenshot it should be at number 5 but exact perpendicular to the line that you have plotted.

            • 3. Re: Vertical line plot
              Jinesh Mehta

              Sorry for the delay...was quite busy. I think I got it working..unless ofcourse I misunderstood your requirements!

               

              Attached is the screenshot of the output and here are the steps:

               

              a. Create a calc field called Total Variable with the following formula (note the brace brackets which are required for it to be a LOD calc:

              {SUM([Variable])}

               

              b. Create a calc field called Mark with teh following formula:

               

              If RUNNING_SUM(sum([Variable])) > sum([Total Variable])*0.98

              AND lookup(RUNNING_SUM(sum([Variable])),-1) < sum([Total Variable])*0.98

              then sum([Total Variable])

              else 0

              END

               

              c. Create a dual axis chart (refer to my screenshot to see how I have placed the fields on row, column, color  and label fields to recreate the viz

               

              Hope this helps!