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

Sub Totals not equalling


Hi

I've added an expression in my table that returns a zero based on the condition and it seems to be working ok but for some reason the column total is still including the value of the records that return zero

  So I'm returning zero when ActualCostsLC - SalesActualCostslC = 0 otherwise I'm bringing in the sum of PlannedCostsLCV0.

=

if(sum(ActualCostsLC)- sum(SalesActualCostsLC) = 0 , 0, sum(PlannedCostsLCV0))

The report returns zero for the condition but when I add a subtotal I still get the values in the total that have been excluded

9 Replies
sunny_talwar

Try this:

=Sum(Aggr(if(sum(ActualCostsLC)- sum(SalesActualCostsLC) = 0 , 0, sum(PlannedCostsLCV0)), YourDimensions))

Not applicable
Author

Hi

Thanks but it didn't work, for some reason it bought in all of the values

sunny_talwar

That is strange, I would have expect the individual rows to have returned the same result, but only subtotal to add up each of the row. Are you trying to do this in a pivot table or Straight Table?

Not applicable
Author

Sorry , the values were excluded but the subtotal was the same, for the dimension in the formula I'm brining in the dimension that I'm subtotalling on ?

Not applicable
Author

so the individual rows are returning the same result but the total is still not working and its a pivot table

sunny_talwar

Add all the dimensions and see if that helps.

Not applicable
Author

Thanks I've got it working now

sunny_talwar

Awesome

I am glad it worked out for you.

Best,

Sunny

Not applicable
Author

Hi Thomas

PFA the qvw. It may help you

Regards

Chitra