Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate KPI

hi guys,

     I have a little problem with KPI calculation.

I've this situation:

Dateemployeesrevenue

01/01/2017

5

120000
01/02/20175125400
01/03/20175150000
01/04/20175140000
01/05/20175132500

I have to calculate revenue / employees like :

                    sum(revenue) / employees

that is:

                    667900 / 5

But on qlikview if I write:

               = sum(revenue) / employees


I get back " - " symbol


so I try:

          = sum(revenue) / sum(employees)


this works but the result is incorrect because the values are:

                    667900 / 25

How can I do?


This is an example and the original table have more values than this.


Thanks

13 Replies
Anil_Babu_Samineni

May be this?

sum(revenue) / Count(employees)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I tried, but this solution doesn't work

trdandamudi
Master II
Master II

Try as below:

Sum(revenue) / Count(Total employees)

Anil_Babu_Samineni

Why not?

Capture.JPG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Clever_Anjos
Employee
Employee

sum(revenue) / sum(employees)    

Anonymous
Not applicable
Author

Doesn't work

Anonymous
Not applicable
Author

This example works because there are 5 months, but if you add june, the result of count(employees) will be 6, but the real number of employees is 5

Anil_Babu_Samineni

What you mean real ?? May be this? If none of them not works, I would suggest provide real data

sum(revenue) / Count({<employees = {5}>}employees)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

In this case the result of sum(employees) is 25, but the real number of employees is 5, so this solution doesn't work.

I need to divide the sum(revenue) for the number of employees