Skip to main content

I'm using Tableau Desktop 9.2.7 and I'm struggling to "drill, baby, drill"-- down hierarchies, that is.

I've been working to get nice views to employee work hours and coming up empty-handed: I can't seem to reach the specific information I want (hours that have been limited by the selected hierarchy). Instead, I get all employees or the sum of hours by managers. Help!

 

Here's what I'm working with:

  • I have one spreadsheet that includes Employee ID, Employee Name, and the full reporting hierarchy of that employee
  • The reporting hierarchy is in multiple levels: the President appears by himself on Level 1; Vice presidents appear on Level 2 (superseded by the President on Level 1), and so on.
  • I have a second spreadsheet of hours worked (keyed by Employee ID).

 

Here's what I'd like to see:

  • When people log on, they can see their names and the hours they've worked (I'm concatenating the reporting hierarchy and using USERNAME to ensure users only have visibility to themselves or people they manage)
  • IF they have people reporting to them, they can click on the next level of the the hierarchy and see those people and their hours displayed
  • And so on, and so on.

 

That progression would look something like this (the work hours do not match those in sample set).

Drill, Baby, Drill-- Down Hierarchies

 

Can anyone offer some words of wisdom?

8 risposte
  1. 20 mag 2016, 21:10

    Michael,

     

    Try this calculation instead of just sum of hours:

     

    Michael, Try this calculation instead of just sum of hours: CASE IF ISNULL(ATTR([Level 2])=

    CASE

        IF    ISNULL(ATTR([Level 2])="*") THEN "level1"

            ELSEIF ISNULL(ATTR([Level 3])="*") THEN "level2"

            ELSE "level3"

        END

    WHEN "level1"

        THEN SUM(

            IF [Employee Number] <= [Level 1]

                THEN [Hours]

                ELSE 0

            END)

    WHEN "level2"

        THEN SUM(

            IF [Employee Number] <= [Level 2]

                THEN [Hours]

                ELSE 0

            END)

    ELSE SUM([Hours])

    END

     

    I used the following two pages, it took me a couple of hours to reason it out.

     

    Re: Determine which level of a hierarchy is active (expanded)

     

    SUM IF Responses = "Strongly Agree" "Somewhat Agree" "Agree"

     

    Cheers!

0/9000