Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a chart that looks up sum of employees per region when the headquarter filed has a value of 1.
the expression that I am using is :
Sum(
if (Headquarters =1
, Employees
)
)
and the dimenssion is Region.
The chart is not showing any data. while if I put the fields in a table box then I see all of them.
I have tried "For testing" to change the exprission to Sum(Employees) and it worked out.
Not sure what's wrong with the main exprission!
Thanks for any help!!
Thanks,
Alec
If the expression sum(Employees) works in the same chart, the problem is with the condition. Either you misspelt the field name "Headquarters", or there is no value "1", or there are no Employees data for Headquarters = 1. Try to add Headquarters as dimension, it may help to see.
Hi Alec,
You are looking for count not sum...
Change expression accordingly for answer
Regards
Kulbir
How are the fields Headquarters, Region and Employees related to each other? Could it be that if(Headquarters = 1,..) doesn't return an unambiguous answer if evaluated in your context?
If the expression sum(Employees) works in the same chart, the problem is with the condition. Either you misspelt the field name "Headquarters", or there is no value "1", or there are no Employees data for Headquarters = 1. Try to add Headquarters as dimension, it may help to see.
here is a sample of the table bo. i have exported to excel.
I don't see any issue in the relationship among the three fields.
Region | Employees | Headquarters |
Asia Pacific | 2 | 1 |
USA | 50 | 1 |
Asia Pacific | 0 | 0 |
Asia Pacific | 1 | 0 |
USA | 8 | 1 |
Asia Pacific | 15 | 1 |
Try this:
sum(Employees*Headquarters)
It is just a misspelling issue.
I really should be more careful and not bother other PPl before I look at it.
Thanks for all of you.