Calculated Field - Divide 2 columns after a date aggregation

Hello,

I have ‘amount ($)’ column that I would like to divide by a ‘quantity’ column in order to get a ‘rate’ column that I would like to display in a table view. It works fine when the ‘date’ column is not aggregated, however when I aggregate the date column by month, it sums the rate (see picture). I would like if possible the rate could be calculated after the aggregation has taken place so that the rate is accurate. (The correct rate in the picture should be 0.75)

Screenshot 2023-08-30 143512

Thanks!

Hi @noel. Can you test if using a level aware calculation with a POST_AGG_FILTER calculation level returns the correct rate?

Hey Max, I believe that works. Here is the solution: sumOver(sum(total)/sum({total_quantity}),[date, {id}, {service_name}], POST_AGG_FILTER)

It seems to be working, thanks!