Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

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
Highlighted
Not applicable

okay i made it work..

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

View solution in original post

11 Replies
Highlighted
Master III
Master III

Try this

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


Highlighted
Not applicable

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

Highlighted
Creator III
Creator III

Did not work sorry

Highlighted
Not applicable

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

Highlighted
Creator III
Creator III

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

Highlighted
Creator III
Creator III

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

Highlighted
Creator III
Creator III

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.

Highlighted
Not applicable

okay i made it work..

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

View solution in original post

Highlighted
Employee
Employee

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