Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sibrulotte
Creator III
Creator III

Partial sum of rounding

Hi,

have any of you come across this:

(sum({$<[%CLE_Type_Transaction_ID] -= {'EB', 'EA'}, [Numéro du type d'écriture] -= {'FERM'} >}[Montant cumulé aad]* %CR003M))

This returns a two decimal number.

When I wrap it with round, I get a rounded number.

Unfortunatly, the partial sum didn't get the memo...

It still treats the numbers as two decimals, and returns a rounded number that is off.

See my jpgs for as an exemple.

12 Replies
jerem1234
Specialist II
Specialist II

I don't know if you saw my edit, but you may be able to get away with just:

sum(aggr(round(sum(Value)), Type, Product))


This should reduce the formula a bit.

sibrulotte
Creator III
Creator III
Author

Yeah, did, I tested in your file and it worked in deed.

But I have at least 40 some expressions to change with each 3 to 4 dimensions, and that is without taking into account a sandbox that has 20 some dimensions and 20 some expressions. Using AGGR requires that I explicitly state which dimension I am agrregating for right?

jerem1234
Specialist II
Specialist II

Unfortunately yes, but if some charts use the same dimensions, you could create a variable vAggr with a value:

Type, Product

Then for your expression your could do:

sum(aggr(round(sum(Value)), $(vAggr)))

Other than that, you could leave it the way it is and just let the user know that the rounding takes place after the summing (which therefore the partial sum is not always the sum of the rows above). In all honesty, this probably gives more of an accurate sum.

Hope this helps!