2 Replies Latest reply on Jun 24, 2016 3:25 AM by Rohit Yadav

    Minimum, Maximum, Median Calculation Required

    Rohit Yadav

      Dear Users,

       

      I have data where there are list of employees in a company and also there immediate supervisor,

      immediate supervisor will also come under employee list .

       

      I want is minimum number of reporters to any supervisor also maximum and median.

       

      I am attaching a sample Tableau File for your reference.

       

      Request you to help..

       

       

      Thanks and Regards,

      Rohit Yadav

        • 1. Re: Minimum, Maximum, Median Calculation Required
          Ricard Kelly

          For some reason I can't see the underlying data to verify the precise information you are working with, but I think I get what you are asking based on what I can see in the calculated fields.

           

          The way to calculate the solution is to change the calculation you have for [Employee Count] to be:

          {INCLUDE [IS PS No.]: COUNTD([Personnel Number])}

          This causes the COUNTD function to be run for each unique value in the dimension [IS PS No.].  The COUNTD function therefore aggregates the count of unique [Personnel Number] values (i.e. employees) for each unique immediate supervisor.

           

          The resulting calculation may be fed to the MIN, MEDIAN and MAX functions to obtain the values you seek.

           

          Making that change to the calculation of [Employee Count] breaks the [Average Span] calculation, but you can get this back by changing the [IS Count] calculation to aggregate over a dimension which you wish to report by group, but you don't need either of those calculations to get the MIN, MEDIAN or MAX values for the complete data set or for groupings based on other dimensions.

           

          Hope that helps.

          • 2. Re: Minimum, Maximum, Median Calculation Required
            Rohit Yadav

            Mr Kelly ,

            Thank You

            Its working fine.

             

            Thanks and Regards,

            Rohit