Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum of Top 10 weeks

Hi,

I am looking for an expression for the below scenario..

I have employeeName, week, hours information.

now i want to calculate the sum of hours of an employee who exceeds 20 hours a week for more than 10 weeks.

To be more clear...


an employee who  spent more than 20 hours for more than 10 weeks, now i need sum of these 10 weeks hours.


kindly help me with the expression ..


Thanks,

Dileep.

6 Replies
Not applicable
Author

it goes like this...

Sum of hours where hours > 48 for more than 10 weeks.

I need top 10 sum values here..

Its urgent , kindly help me asap.

Gysbert_Wassenaar

Please post a small Qlikview document that illustrates the problem.


talk is cheap, supply exceeds demand
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi there,

Can you upload a sample of your data? That way we can make a solution for you.

Regards,

MB

Not applicable
Author

Hi Dileep,

I guess this is what you were searching for.

It is working with aggregated values in the data model.

it is using applymap() of weeks per employee to get the "where sum(hours) per week and employee is >=20"

Kushal_Chawda

Assuming Week is Number 1,2,3

=Sum({<Hour={"=Sum({<Week={">=$(=max(Week)-10)"}>}Hour)>20"}>}Hour)

Kushal_Chawda

or better to use Date

Sum({<Hour={"=Sum({<Date={">=$(=max(Date)-70)"}>}Hour)>20"}>}Hour)