Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis

Hello,

I have the data like this. Here I'm calculating the %Over time. = OverTime_Hrs/PlannedHrs

Now I'm trying to calculate the Number of staff who worked more than 15% in a text box. Please advise.

stalwar1

  

EMPLOYEE_IDPLANNED_HOURSACTUAL_HOURS_DOCOverTime_HOURS
62143440595155
62238440588148
6262644046727
62735440547107
62793440600.2160.2
63465440499.559.5
63563440930
638984404477
4242440487.547.5
643664404422
64829440577137
65120440517.577.5
1 Solution

Accepted Solutions
7 Replies
Anonymous
Not applicable
Author

=sum(if((OverTime_HOURS/PLANNED_HOURS)>0.15,1))

sunny_talwar

May be like this:

Count(DISTINCT {<EMPLOYEE_ID = {"=OverTime_HOURS/PLANNED_HOURS >= 0.15"}>} EMPLOYEE_ID)

sunny_talwar

Sample

Capture.PNG

jagan
Partner - Champion III
Partner - Champion III

HI Vinay,

Try like this

Count(DISTINCT {<EMPLOYEE_ID = {"=Sum(OverTime_HOURS)/Sum(PLANNED_HOURS) >= 0.15"}>}EMPLOYEE_ID)


OR  try using Aggr() like below

Sum(Aggr(If(Sum(OverTime_HOURS)/Sum(PLANNED_HOURS) >= 0.15, 1, 0), EMPLOYEE_ID))


Regards,

Jagan.

Anonymous
Not applicable
Author

Bro, Instead of Count staff, can I do calculate the % of staff who worked > 15%. Please help for this expression also..

sunny_talwar

May be this:

Count(DISTINCT {<EMPLOYEE_ID = {"=OverTime_HOURS/PLANNED_HOURS >= 0.15"}>}EMPLOYEE_ID)/Count(DISTINCT EMPLOYEE_ID)

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

Count(DISTINCT {<EMPLOYEE_ID = {"=Sum(OverTime_HOURS)/Sum(PLANNED_HOURS) >= 0.15"}>}EMPLOYEE_ID)/Count(Distinct EMPLOYEE_ID)


OR  try using Aggr() like below

Sum(Aggr(If(Sum(OverTime_HOURS)/Sum(PLANNED_HOURS) >= 0.15, 1, 0), EMPLOYEE_ID))/Count(Distinct EMPLOYEE_ID)