I want to calculate the value on each order in a table, then round each value to the nearest 2 decimal place, and then add up all those rounded numbers. But when Aggregate Table Data by SUM I am not getting the same result as the Total for my ROUND metric. It seems the SUM row is rounding and then summing, but the ROUND metric is summing and then rounding, then they're getting different results for the same metric. Can you help me with this? Slice metric1 by attribute2, round sliced metric to two decimal places, then sum the rounded values?
Best answer by Michael UllockView original
thanks for sending this in - In this case, your metric would look something like this:
SELECT SUM( SELECT ROUND( (SELECT SUM(Revenue) BY Attribute, ALL OTHER),2))
Can you please give this a go and let us know how you get on?
If you would like to learn more about our ROUND function, please see the below article:
Thank you! This solved my problem :)