2 Replies Latest reply on Oct 5, 2015 8:02 AM by Rody Zakovich

    Getting min value on table calculation

    venkat Mothukuri

      I have running total calculation field. In this I would like to extract values greater than 80 and less than 90.

       

      Field 1         Trans Time Days

      ======        ============

      7.14 %               12

      9.02 %               14

      81.05 %             34

      81.63 %             55

      82.80 %             78

       

      In this example I need to extract values greater than 80 % and out of 3 values, I would like to get min value(I,e.,81.05%) and display the trans time days for the minimum value.

       

      Any help would be appreciated.

       

        • 1. Re: Getting min value on table calculation
          Esther Aller

          Hi Venkat,

           

          Are you applying a table calculation to a field to get the running total? If so, you can get the formula for any table calculation by dragging the field into the calculation editor in Tableau Desktop 9.0 and later versions. The Customizing Table Calculations entry of the online Product Help has detailed directions for converting table calculations into formulas.

           

          Assuming there is a field that returns the running total percentage of Trans Time Days, which I will call "Running Total Percentage", the following calculation will return only values of [Running Total Percentage] that are greater than 80%:

           

          IF [Running Total Percentage] >= .8

          THEN [Running Total Percentage]

          END

           

          To find the minimum percentage of percentages over 80% can be found by modifying the above calculation:

           

          MIN(

          IF [Running Total Percentage] >= .8

          THEN [Running Total Percentage]

          END

          )

           

          I hope this answers your question!

          • 2. Re: Getting min value on table calculation
            Rody Zakovich

            Hello Venkat,

             

            Can you provide more details on what your expected end result would be?

             

            Ether's response should get you most of the way there, but I am confused by this statement

             

            I would like to getmin value(I,e.,81.05%) and display the trans time days for the minimum value.

             

            Do you want to ONLY display the Trans Date for the minimum % of Running Total Percent between 0.8 AND 0.9?

             

            Also, since Running Total Percentage is a Table Calc, you need to adjust the above calc

             

            [adjustedRunningTotalPercentage]

             

            IF [Running Total Percentage] >= 0.8

            AND [Running Total Percentage] < 0.9

            THEN [Running Total Percentage]

            END

             

            [minTransDate] =>

             

            IF [Running Total Percentage] = [adjustedRunningTotalPercentage]

            THEN MIN([Trans Time Days])

            END

             

            You may need to play around with what these Table Calcs are addressing. If you could provide an example workbook it would be very helpful.

             

            Regards,

            Rody