# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Contributor II

## Expression Problem

Quick Question, I have a simple Expression in a line chart. I wanted to modify it so it only showed a single Work Group so that I can display all of them on a single chart. Right not my expression works, but when I try to narrow it down to one group says the expression is ok, but no data.

current:

Sum(Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)/(Count(Phone#Identifier)*100)

New:

if([Work Type]='PPA',Sum(Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)/(Count(Phone#Identifier)*100))

I have attached a version of the report for reference.

1 Solution

Accepted Solutions
Not applicable

## Re: Expression Problem

Sum({<[Work Type] ={'PPA'}>}Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)

/

Count({<[Work Type] ={'PPA'}>}Phone#Identifier)*100

thats how.. but first you gotta delete all calculations in your chart.. I dont know why.. start creating a new chart that worked for me. let me know if you could get it to work pls

11 Replies
Honored Contributor III

## Re: Expression Problem

Try this

Sum(if([Work Type]='PPA',Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7))/(Count(Phone#Identifier)*100)

Not applicable

## Re: Expression Problem

Hey there,

Have you tried this:

Sum({<[Work Type] ={"PPA"}>}Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)

/

Count({<[Work Type] ={"PPA"}>}Phone#Identifier)*100

Greetings Patrick

Contributor II

## Re: Expression Problem

Did not work sorry

Not applicable

## Re: Expression Problem

Could you provide a demo.qvw so i can try a little bit?

Contributor II

## Re: Expression Problem

sure, I can do that shortly. I forgot about Set Analysis, that seems like a good way to do it and like it should work, but no results

Contributor II

## Re: Expression Problem

I have attached a version of the report on my original post for reference.

Contributor II

## Re: Expression Problem

I could add the field as a dimension to run my current Expression off of, but I'd like to be able to set these in the expression if need be as well.

Not applicable

## Re: Expression Problem

Sum({<[Work Type] ={'PPA'}>}Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)

/

Count({<[Work Type] ={'PPA'}>}Phone#Identifier)*100

thats how.. but first you gotta delete all calculations in your chart.. I dont know why.. start creating a new chart that worked for me. let me know if you could get it to work pls

Highlighted
Employee

## Re: Expression Problem

Hi ... The original expression definition is: Sum() / ( Count() * 100 ) ... in the case of Work Type = 'PPA', you should use:

Sum({<[Work Type] ={"PPA"}>}Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)

/

(Count({<[Work Type] ={"PPA"}>}Phone#Identifier)*100)

the original definition is

Sum({<[Work Type] ={"PPA"}>}Score0+Score2+Score1+Score3+Score4+Score5+Score6+Score7)

/

Count({<[Work Type] ={"PPA"}>}Phone#Identifier)*100, for any reason the () in the COUNT produce a mistake