Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional SUM

Hello,

I need to sum just part of the FACTS in this way:

Suppose Facts Table

Customer     Sales

A                    20

B                    20

C                    30

A                    50

I want an expression with total sales from Customers with sales greater then 60, in this case it would be 70.

What would be the expression?

Thanks in advance.

Prata

1 Solution

Accepted Solutions
sunny_talwar

This can be another way to do it, if you are doing this in a text box object:

Sum(Aggr(If(Sum(Sales) > 60, Sum(Sales)), Customer))

for a straight table use the below expression with Customer as your dimension

If(Sum(Sales) > 60, Sum(Sales))

View solution in original post

3 Replies
swuehl
MVP
MVP

Use set analysis with an advanced search in customer field:

=Sum({<Customer = {"=Sum(Sales)>60"}>} Sales)

A Primer on Set Analysis

reddy-s
Master II
Master II

Hi Ricardo,

This should help you as well.

Set Analysis: syntaxes, examples

sunny_talwar

This can be another way to do it, if you are doing this in a text box object:

Sum(Aggr(If(Sum(Sales) > 60, Sum(Sales)), Customer))

for a straight table use the below expression with Customer as your dimension

If(Sum(Sales) > 60, Sum(Sales))