Solved

Can we swap dimension and data of a metric?

  • 6 March 2024
  • 6 replies
  • 115 views

Userlevel 1
Badge +4

Hi,

I currently have two metrics and three dimensions involved (Job position, Employee, Month):

  1. Metric Manager_job position, with two dimensions Month and Employee, data type is Job position, where I store the manager’s job position for each employee by month
  1. Metric Employee_job position, with two dimensions Month and Employee, data type is Job position, where I store their own job position for each employee by month

I tried to create a metric with Month and Employee dimension, data type Employee, which shows me the Manager’s Name (dimension Employee) for each employee by month, but I didn’t success to make it.

 

Can you give me some advice?

Thanks in advance!

icon

Best answer by francois 6 March 2024, 16:19

View original

6 replies

Userlevel 3
Badge +5

Hello @Weining Ben ,

 

Thank you for all the information provided!

 

It seems like what you are missing is the way of connecting the dots. In this case, how to connect the Manager with the employees. You could try to do that through the Job Position - if it was the same- but I suspect that the Job Position will be specific for each employee. 

 

Do you have a department / team dimension (or any other) where the manager will be unique for the employees within that common dimension?


Cheers!

Userlevel 1
Badge +4

Hello @BrunoRodriguez ,

In my case, every employee will only have one manager that month.
So I’m trying to convert Metric Employee_job position to a new metric like Job position_Employee (with dimension Seat, Month and Data Employee) as below.

  • Employee_job position
  Jan Feb Mars
Emp_1 JP_1 JP_1 JP_1
Emp_2 JP_2 JP_2 JP_2

 

  • Job position_Employee
  Jan Feb Mars
JP_1 Emp_1 Emp_1 Emp_1
JP_2 Emp_2 Emp_2 Emp_2

Then I think I could link it with another metric Manager_job position to get the result.

Do you think it’s doable or not?

Thanks a lot,

Userlevel 3
Badge +5

Hello @Weining Ben ,

 

As I understand it, the Manager will be defined based on the Job Position that each employee has in a Monthly basis. 

I believe that what you currently have resembles these two metrics, where:

  1. Employee_Job Position: Dimensioned by Employee and Month with Job Position data type.

 

  1. Job Position_Manager: Dimensioned by Job Position and Month with Employee data type.

 

If my assumption about what you have available is correct, what you need to do is connect both metrics through the following formula - where you will take very manager for each employee based in the position:

JP_Manager[BY CONSTANT: Employee_JobPosition]

 

 

I hope the above makes sense. Please let me know if that is feasible in your situation.

 

Cheers!

Userlevel 1
Badge +4

Hello, @BrunoRodriguez 

Inspired by you, I know how to explain my problem more clearly!

These are my existing two metrics:

  1. Employee_Job Position
  1. Employee_Manager Job Position

Therefore, we can see the position of each employee, and the position of each employee's manager.

Then what I need to get is to calculate who is the manager of each employee :

Sorry for wasting your time, hope this explains my question clearly enough :)

Regards,

Userlevel 6
Badge +14

Hi!

It looks like you have a direction issue - in your dataset, you can assign the same position to different employees, which makes it harder to look for the right manager. 

Employee[ADD: Month][BY FIRSTNONBLANK: Employee -> Employee_JobPosition]
 

As a first step, I would probably invert the data to present the first available employee mapped to a position

 

Employee[ADD: Month][BY FIRSTNONBLANK: Employee -> Employee_JobPosition][BY: 'Job Position' -> 'Manager_Job Position']

You can then apply that rule by applying it to the Manager Job Position metric.

 

As a reminder, here are Bruno’s assumptions for both metrics

 

I would strongly advise on flipping the metrics the other way around, e.g. selecting an employee on each position if that is something you can do.

 

Hope this helps!

François

Userlevel 1
Badge +4

That's exactly what I wanted. And we'll also consider your advice on our own.

Thanks a lot for your help. 👍

Best regards,

Reply