Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Mario1011
Contributor
Contributor

if function... am i missing something??

Not sure why this is not working in my graph?

if(sum({$<Type={'Actuals'}>}Amount)>0,count(distinct[Position ID]))

if(sum({$<Type={'Budget'}>}Amount)>0,count(distinct[Position ID]))

Answer should be '8' for Budget and '7' for Actuals - i keep getting '9' as the answer

Position IDJobTitleBudget : AugActuals : Aug
Total $56,342$53,164
60090929MANAGER FRONTLINE RECRUITMENT$12,123$12,162
60090935RECRUITMENT ADVISER$7,296$7,219
60090936RECRUITMENT ADVISER$6,964$6,949
60090937RECRUITMENT ADVISER$0$6,805
60090938RECRUITMENT ADVISER$5,970$5,937
60090939RECRUITMENT ADVISER$6,434$0
60090940RECRUITMENT ADVISER$7,793$7,615
60090942RECRUITMENT ADVISER$3,008$6,478
60090943RECRUITMENT ADVISER$6,754$0

 

 

1 Solution

Accepted Solutions
SergeyMak
Partner Ambassador
Partner Ambassador

Actually better way is

Count({$<[Position ID]={"=sum({$<Type={'Actuals'}>}Amount)>0"}>}[Position ID])

it doesn't use if, which is much better

Regards,
Sergey

View solution in original post

3 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

Hi Mario,

It all depends where are you trying to calculate it.

If you do it in the same table with the dimensions you have, your calc should work for total, but if you do it in text object you need to use AGGR

if(AGGR(sum({$<Type={'Actuals'}>}Amount),[Position ID])>0,count(distinct [Position ID]))

 

Regards,
Sergey
Mario1011
Contributor
Contributor
Author

I got it working - thanks Sergey....
SergeyMak
Partner Ambassador
Partner Ambassador

Actually better way is

Count({$<[Position ID]={"=sum({$<Type={'Actuals'}>}Amount)>0"}>}[Position ID])

it doesn't use if, which is much better

Regards,
Sergey