3 Replies Latest reply on Sep 27, 2018 4:23 PM by swaroop.gantela

    How to add annotation or text to show sum of %'s over a given value

    Mike Shi

      Hello all,

       

      I have a density chart that shows "entry minutes" as a dimension on the x-axis and the count of each "entry minute" occurrence in the y-axis (as a % of pane total).   I am trying to figure out a way to get to the sum of the %'s over 135 minutes in each pane.  For example, in Shift 1, this number would be 2.5%, which is all of the bars over 135 minutes added up. 

       

      tableau example 8.jpg

        • 1. Re: How to add annotation or text to show sum of %'s over a given value
          swaroop.gantela

          Mike,

           

          I mocked something up in Superstore, not sure how close it is to your true setup.

          But maybe it can give ideas.

           

          Got the count per EntryMinutes using:

          { FIXED [ShiftNumber],[EntryMinutes]:COUNT([EntryMinutes])}

           

          Numerator for overmark became:

          { FIXED [ShiftNumber]:SUM(

          { FIXED [EntryMinutes]:MAX(

          (IF [EntryMinutes]>=10 THEN [count PerEntryMinute] END)  )} )}

           

          Denominator for overmark became:

          { FIXED [ShiftNumber]:COUNT([EntryMinutes])}

           

          percent overmark:

          [Numerator]/[Denominator]

           

          Please see workbook v10.3 attached in the Forum Thread.

          1 of 1 people found this helpful
          • 2. Re: How to add annotation or text to show sum of %'s over a given value
            Mike Shi

            Swaroop, thank you for your help. While your formulas weren't exactly what I needed, your methodology was.

             

            I only need a Numerator, Denominator and "OverMark" calculated field.

             

            Numerator:

            {EXCLUDE [Entry Minutes Round]:SUM(

            (IF [Entry Minutes Round] >=

            (IF int(right(left([Shift Number],7),1)) > 3 THEN 90

            ELSE 135

            END)

            THEN 1 ELSE 0 END

            ))

            }

             

            Denominator:

            {EXCLUDE [Entry Minutes Round]:COUNT([Entry Minutes Round])}

             

            OverMark:

            [Numerator]/[Denominator]

             

            Now I just need to figure out how to get the OverMark label to just show up where I want it.  In the example below, I have all of the other marks on the other bars hidden, but they do appear of I change anything around:

             

            tableau example 9.jpg

             

            tableau example 9b.jpg

            • 3. Re: How to add annotation or text to show sum of %'s over a given value
              swaroop.gantela

              Mike,

               

              Glad you got a solution.

               

              This may be overkill, but you can try a calculated field to just label, for example,

              the first bar over the threshold:

               

              IF [EntryMinutes]=

              { FIXED [ShiftNumber]:MIN(

              IF [Overmark] THEN [EntryMinutes] END)}

              THEN [% over mark] END

               

              Please see workbook v10.3 attached in the Forum Thread.

              1 of 1 people found this helpful