0

I have the following Table in Tableau server and using USERNAME() will return the 'Employee' value.

+----------+---------+----------+
| Employee | Manager | Job Role |
+----------+---------+----------+
| jdoe     | hwu     | Analyst  |
| anon     | hwu     | IT       |
| jlaw     | hwu     | Analyst  |
| kreaves  | bpitt   | Analyst  |
| jlopez   | bpitt   | IT       |
| mmoss    | bpitt   | IT       |
+----------+---------+----------+

Goal: Find users similar to self based on parameter. Parameter values - Manager, Job Role.

Example: My USERNAME() is jdoe. When I choose the parameter value 'Manager', tableau filters and gives a result of employees under 'hwu' only, as shown below.

+----------+
| Employee |
+----------+
| jdoe     |
| anon     |
| jlaw     |
+----------+

Similarly, when Job Role is selected, it filters to a list of users with the job role 'Analyst', as shown below.

+----------+
| Employee |
+----------+
| jdoe     |
| jlaw     |
| kreaves  |
+----------+

I know there should be a simple solution to this using LOD calculations, but I am stumped on how to approach this!

woodhead92
  • 127
  • 1
  • 14

1 Answers1

0

Make a calculated field that uses UserName(), your parameter and whatever fields are needed that produces a boolean value. Use that field to filter for the rows of interest.

For example, create a calculated field called [Value of Interest] if [My Param] = "Manager" then [Manager] else [Job Role] end

And another calculated field called [My Value of Interest] { min(if [Employee] = username() then [Value of Interest] end) } That's your LOD calc.

Now you can put a calc on the filter shelf that tests whether [My Value of Interest] = [Value of Interest]

I'm not at place where I can test this but it should get you started

Alex Blakemore
  • 11,301
  • 2
  • 26
  • 49
  • How do I get the corresponding ManagerName/JobRole to USERNAME()? I feel LOD calculations should be used for this, but I am not sure how. – woodhead92 Dec 12 '16 at 23:12