Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
aisolomatin
Contributor III
Contributor III

Set analisys: sum with specific condition

Good day!

Need your help.

I got some data:

forum_table_2.png

I need to make expression for New_sum(Value) with condition:

- if there is only Subbranch "no_sub" in Branch, then we don't sum value. If there are other Subbranches, then we sum all of them.

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Sum({<Branch = {"=Count(DISTINCT Subbranch) = 1 and Subbranch = 'no_sub' "}>}Value)

My bad, you need this:

=Sum({<Branch = {"=Not(Count(DISTINCT Subbranch) = 1 and Subbranch = 'no_sub')"}>}Value)

View solution in original post

3 Replies
sunny_talwar

May be like this:

Sum({<Branch = {"=Count(DISTINCT Subbranch) = 1 and Subbranch = 'no_sub' "}>}Value)

My bad, you need this:

=Sum({<Branch = {"=Not(Count(DISTINCT Subbranch) = 1 and Subbranch = 'no_sub')"}>}Value)

sunny_talwar

Or this:

=Sum({<Branch = {"=Count(DISTINCT Subbranch) <> 1 or Subbranch <> 'no_sub' "}>}Value)

aisolomatin
Contributor III
Contributor III
Author

Sunny, great! thank you!