Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Gaz4OakM
Contributor
Contributor

Expression to Sum only accounts with a count greater than zero on measure X

I am having trouble creating a expression, 

count({<[Product Category]={[X]}>}AccountID)

The above will give the count of "X" in any given AccountID

However i now what to pull the sales only on those AccountIDs . However i want this by Area.

My headings would be Area, Count, Sales

Everything i have tried so far will bring back total sales on all accounts whether or not they have product category X

Ultimately i want to bring back the sales on accounts that product category X to divide by the count to get an average selling price.

Many thanks

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum({<[AccountID] = P({<[Product Category]={[X]}>}), [Product Division] = {[Y]}>}Sales)

View solution in original post

5 Replies
sunny_talwar

May be this

Sum({<[AccountID] = P({<[Product Category]={[X]}>})>}Sales)

Gaz4OakM
Contributor
Contributor
Author

Thanks Sunny

I think i want to add one more part to this, the final part of sales i want it to only pick up [Y] Division 

normally i would write

sum{< [Product Division] = {[Y]} >} [sales] )

to get to those sales

Thanks Again

sunny_talwar

May be this

Sum({<[AccountID] = P({<[Product Category]={[X]}>}), [Product Division] = {[Y]}>}Sales)

Gaz4OakM
Contributor
Contributor
Author

Great that works Perfect, thanks for the prompt help.

Bill_Britt
Former Employee
Former Employee

Hi,

Please make this post solved. 

 

Thanks

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.