# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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 * 8) >= 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])

1 Solution

Accepted Solutions
Esteemed Contributor II

## Re: Sum if Sum - Condition Expression help

AGGR(

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

,[Employee])

For Calculated Dimension

22 Replies
Valued Contributor III

## Re: Sum if Sum - Condition Expression help

Try this

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

Not applicable

## Re: Sum if Sum - Condition Expression help

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

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

Esteemed Contributor II

## Re: Sum if Sum - Condition Expression help

Assuming Employee is a numeric field!

Sum(

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

)

Not applicable

## Re: Sum if Sum - Condition Expression help

This has an expression error?

Not applicable

## Re: Sum if Sum - Condition Expression help

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

## Re: Sum if Sum - Condition Expression help

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

Not applicable

## Re: Sum if Sum - Condition Expression help

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

## Re: Sum if Sum - Condition Expression help

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

Esteemed Contributor II

## Re: Sum if Sum - Condition Expression help

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]))