Skip to main content

Hi,
I have a metric Project Allotted of data type: Project dimension;
metric having dimensions: Employee, Project Role and Integers.

how can I fetch the employee name in a metric “Emp” of data type: Employee and with dimensions: Project Role and Project from the above ABC metric and with Lastnonblank integer?
 

('Employees'.'emp_dim'[ADD: 'Project'][BY:-> 'Project Allotted'][REMOVE LASTNONBLANK: 'Integers','Employees'])

I have tried this formula, but it gives all the allotted Projects in the row header labels for an employee, I want only the last one 


Hi @pigment_enthusiast,

I think before you map by ‘Project Allotted’ you want to have the same dimensionality as the mapping metric.

'Employees'.'emp_dim'
​​​​​​​ BY: 'Employees', 'Integers', 'Project Role'] // first add all dimensions that the mapping metric has
mBY: -> 'Project Allotted'] // map project dimension via the mapping metric
iREMOVE LASTNONBLANK: 'Integers','Employees'] // remove dimensions that aren't needed

 


Hi @oliverlee 
I just tried this,
Target metric is of data type: employees and with dimensions: Project and Project Role
In the pivot view of target metric in rows, there’s Project and Project Role, the employees are coming correct in the column but I am getting multiple Project Name under the same employee and role, and it should show only the last allotted project name


Hi @pigment_enthusiast,

could you elaborate on the output you need and how exactly you’re using the ‘Integer’ dimension? How would the table look like that represents your output?


Hey @oliverlee ,
I have a source metric: Allotted project which is of datatype: Project, 
wherein we are having the assigned projects in each employee’s role.
In the source metric, i have Employees and Project Role in Rows and Integers list in the column. Data Type of source metric is Project.

Output Metric is of data type Employees and it should show only the last allotted projects i.e. “Project Test Name”, “Project 9”, “Project PQR”
 

Source Metric
Output metric should show only the last allotted projects in the rows . i.e. except red ones.

 


Hi @pigment_enthusiast,

thanks for elaborating. To achieve that, you first should identify the latest entry, i.e. ‘Integer’ item, per employee. For example with a separate metric ‘Last Integer per employee’ of type ‘dimension (Integer)’ and with following formula.

Integer>BY: 'Allotted Project']tREMOVE LASTNONBLANK: 'Project Role', Integer]

Then you can use this metric to filter for the right Integer item per employee.

Employees
lBY: Integer, 'Project Role'] // first add all dimensions that the mapping metric has
iBY: -> 'Allotted Project'] // map project dimension via the mapping metric
mFILTER: Integer = 'Last Integer per Employee'] // filter by last relevant integer per employee
pREMOVE LASTNONBLANK: Integer,Employees] // remove dimensions that aren't needed

This should provide you with the result you’re looking for I think. Let me know if it works for you!

However, note that since there is no date attached to the roles, the system cannot know which employee is the correct one per project and role, if there is a conflict. For example, if in your case employee A would be assigned as Product Owner to Project PQR in Integer 3, this entry would probably win against the Employee B who is assigned as Product Owner to Project PQR in Integer 2. Is this the correct behavior?


Reply