Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum if Sum - Condition Expression help

Hello,

Not sure if this is possible, but with the data I am working with I am stuck.

I have these fields:

Billable Hours

Network Days Flag

Employee

I am trying to perform a calculation if the...

(sum of billable hours) - (sum of Network Days Flag * 😎 >= 20, then sum the list of employees.

My current expression(that doesn't work):

Sum(if(Sum([Billable Hours])-Sum([Network Days Flag])*8>=20)[Employee])

Thanks in advance

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

AGGR(

              if( Sum([Billable Hours]) - (Sum([Network Days Flag])*8)>=20,[Employee])

        ,[Employee])


For Calculated Dimension

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

22 Replies
Anonymous
Not applicable
Author

Try this

if( Sum([Billable Hours]-(Sum([Network Days Flag])*8)>=20, count( distinct[Employee]))



Not applicable
Author

try this...i think do you need count Employee, no????

sum({<[Employee]={"$(=Sum([Billable Hours])-Sum([Network Days Flag])*8>=20)"}>} [Employee])

vinieme12
Champion III
Champion III

Assuming Employee is a numeric field!


Sum(

               if( Sum([Billable Hours]) - (Sum([Network Days Flag])*8)>=20,[Employee])

        )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

This has an expression error?

Not applicable
Author

Employee is not numeric, what could I do to solve this?  My issue is trying to chart (in some way) only a list of employees if they are 20 hours or more.  I have been trying to add filters, or an expression in several charts trying to accomplish this.  THANKS

Not applicable
Author

if( Sum([Billable Hours])-(Sum([Network Days Flag])*8)>=20, count( distinct [Employee]))

Not applicable
Author

I am only trying to show employees if they meet the condition of 20 hours or more.  Employee are names, not numeric.  Thanks

Not applicable
Author

count(distimc {<[Employee]={"$(=Sum([Billable Hours])-Sum([Network Days Flag])*8>=20)"}>} [Employee])

vinieme12
Champion III
Champion III

Rodrigo's Solution should work for you

or else try

Sum(

              if( Sum([Billable Hours]) - (Sum([Network Days Flag])*8)>=20,1)

        )


or


SUM(AGGR(Sum(

              if( Sum([Billable Hours]) - (Sum([Network Days Flag])*8)>=20,1)

        ),[Employee]))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.