Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
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!