Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
MalcolmCICWF
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
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
anbu1984
Master III
Master III

Try this

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


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

MalcolmCICWF
Creator III
Creator III
Author

Did not work sorry

Not applicable

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

MalcolmCICWF
Creator III
Creator III
Author

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

MalcolmCICWF
Creator III
Creator III
Author

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

MalcolmCICWF
Creator III
Creator III
Author

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

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

GabrielAraya
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