Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

No data to display in a chart

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

1 Solution

Accepted Solutions
Anonymous
Not applicable

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.

View solution in original post

6 Replies
Not applicable

Hi Alec,

You are looking for count not sum...

Change expression accordingly for answer

Regards

Kulbir

swuehl
MVP
MVP

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?

Anonymous
Not applicable

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.

alec1982
Specialist II
Specialist II
Author

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.

RegionEmployeesHeadquarters
Asia Pacific21
USA501
Asia Pacific00
Asia Pacific10
USA81
Asia Pacific151
Anonymous
Not applicable

Try this:

sum(Employees*Headquarters)

alec1982
Specialist II
Specialist II
Author

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.