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

Sum (Total... with embedded IF?

Hello,

I'm trying to get the total of each column by using the sum(total.... command.  However I also have an embedded If statement and it's producing zero results.

So here is the formula I'm using is this:

sum (total if (sum SALES) > 10, 1, 0)

So I thought that this would produce a total of all rows that had sales greater than $10, but I get zero results.

If I put in  just

if (sum SALES) > 10, 1, 0)

I get a result of 1 or 0 for each row (dimension SALESPERSON)

Any idea why when I add 'sum (total', that I get zero results / no sum ?

Thanks.

11 Replies
Not applicable
Author

There's a couple ideas I have but depending on the scenario.  A couple thoughts I have:

From some excel stuff I've done:

If (sum(sales)>10,sum(sales),"")

Maybe overcomplicating it through a formula, maybe simplify it into an object filter?

Hope it helps Chris.

Jayson

*edit mever mind, I see it got resolved prior to my posting *chuckle*  Good to see you got your result needed all the same.

neetishrai
Contributor
Contributor

i have  a stacked chart and need to calculate the % of total.. so that overall it will be 100%. There are two dimensions date and cust type.

X axis has date.

the numerator works fine and gives me the number. But the complete formula is not working. 

Sum(if(period_id='CY' , customer_cnt))
/ SUM(TOTAL IF(period_id='CY', aggr(sum (customer_cnt),[Local Date])))