4 Replies Latest reply on Dec 8, 2016 4:52 PM by Ivan Young

    Calculation Similar to COUNTIF

    christine reynolds

      I have a table that has 1 row for each employee

      In that row, it lists the employee's manager's name and ID#

      I am trying to calculate the number of direct reports each employee has, as shown below. For example Frank has 3 direct reports (Bob, Dan, and Elliot). So on Frank's row, the  # 3 appears in the EE Direct Span column.

       

      Does anyone know how I would calculate this in tableau?  Is there a comparable function(s) that would be similar to how COUNTIF in excel works?

       

      I thought it may be like this,   { FIXED [Mgr ID ] : countd([EE ID])} but this would result in #3 for Bob, Dan, and Elliot which is NOT what i am looking for it to do.

       

      Thanks!

       

       

       

      EE ID

      EE Name

      Mgr ID

      Mgr Name

      EE Direct Span

      1234

      Adam

      8910

      Chris

      1

      4567

      Bob

      1516

      Frank

      0

      8910

      Chris

      2122

      Hans

      1

      1112

      Dan

      1516

      Frank

      0

      1314

      Elliot

      1516

      Frank

      0

      1516

      Frank

      1234

      Adam

      3

       

       

      EE ID

      EE Name

      Mgr ID

      Mgr Name

      EE Direct Span

      1234

      Adam

      8910

      Chris

      =COUNTIF($C$4:$C$9,A4)

      4567

      Bob

      1516

      Frank

      =COUNTIF($C$4:$C$9,A5)

      8910

      Chris

      2122

      Hans

      =COUNTIF($C$4:$C$9,A6)

      1112

      Dan

      1516

      Frank

      =COUNTIF($C$4:$C$9,A7)

      1314

      Elliot

      1516

      Frank

      =COUNTIF($C$4:$C$9,A8)

      1516

      Frank

      1234

      Adam

      =COUNTIF($C$4:$C$9,A9)