Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
belromvar
Contributor II
Contributor II

Count if sum(value) ist not 0

Hi Community,

I have the following scenario.  I want to create a chart that shows the distribution of products within a project.

The condition is that the sum of the amount for a specific type should not be 0. 

ProjectProductTypeAmount
S3P_ABUD100
S3P_BBUD15
S3P_DBUD50
S3P_DBUD-50

I expect a chart with dimension = "2" (count of  different products <> 0) and the expression = 1 (count of projects). 

The dimension looks like this: 

aggr( Count(DISTINCT {<Product = {"=aggr(Sum({<Type = {'BUD'}>}Amount),Project, Product) > 0"}>} Product), Project) 

but it only works when one project is selected. For multiple projects, it shows an empty value. I am attaching a working example of what I have achieved so far. I think I am quite near, any ideas?

 

Labels (1)
16 Replies
belromvar
Contributor II
Contributor II
Author

Sorry, not yet, the expression returns always 1.

dist2.PNG

 

sunny_talwar

Would you be able to share a sample where we need to have more than one Project? I think the sample always have 1 project for each count(Product).

belromvar
Contributor II
Contributor II
Author

 
sunny_talwar

Check attached

belromvar
Contributor II
Contributor II
Author

Hi Sunny, 

see attached  QVW and image, the count is still not returning the correct value.

 

dist3.PNG

sunny_talwar

Don't think this is possible. but may be someone might have another trick to do this

belromvar
Contributor II
Contributor II
Author

Thanks for the help. I decided to use 2 overlapped charts to achieve the goal. 😃