Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
alespooletto
Creator
Creator

Question on how to make a measure for individuals scale for all individuals in a team

Hello, I have the following measure which I use to obtain a measure of efficiency for an individual employee. I would like to make it work for all of the employees instead. This means that, for me, the employee should be compared to the average of all the other ones grouped together.

I tried using set expression, but I am afraid with the logic that I use here it's going to be counterproductive, as I added {< Employee = >} to all spots I could and it still doesn't work out well. 

 

 

Alt(
  (
      Sum(
          Aggr(
              Count( {< ACTION_CODE = {'LABOR_OFF'}>} distinct MainSFC) * Tempo_Medio,
              MainSFC
          )
      )
  )
  /
  // Conteggio ore in minuti per giorno distinto e moltiplicato per numero dipendenti
  (
      (
      Count( 
          distinct GiornoSettimanaLavorato
      ) 
      * 7.5 * 60 * GetSelectedCount(Employee)
      )

  // Sottrarre le ore di assenza disponibili 
          - 
          IF(
              GetSelectedCount(Employee) > 0, 
              Sum(Absence * 60),
              0
          )
  )
  ,0
)

 

 

 

 

Labels (1)
4 Replies
ali_hijazi
Partner - Master II
Partner - Master II

Honestly your question is not clear
would you please share a sample qvf file or data
and explain the expected result via an exel file or image , or any other means

I can walk on water when it freezes
F_B
Specialist
Specialist

Hi @alespooletto ,

I'm not sure this is what you are looking for, but you could replace GetSelectedCount(Employee) with  Count(distinct Employee)

ali_hijazi
Partner - Master II
Partner - Master II

Hello
The GetSelectedCount(Employee) returns zero if user didn't select any value under Employee
even if there are several possible values

This function returns the number of selected values and not number of actual values

so I assume in your expression you are trying to check if there is at least one employee then do a sum
thus as @F_B  is saying you need to use Count(distinct Employee) instead of GetselectedCount(Employee)

I can walk on water when it freezes
alespooletto
Creator
Creator
Author

Hello everyone. First of all, thanks for the replies, secondly I want to say I managed to solve this using different aggregations for the count in the nominator of the formula, and by changing - as many suggested - the function not to take the GetSelectedCount(Employee) but the Count. 

Thank you