How to get the average daily sent per delivery code in a month?
In my query in the additionnal column, in my ouput column I am trying to edit an expression to get the average of the daily success avg = ((success sent) x last 30 days)/30 per delivery code
But I am not sure to well write the function to use, any tips to wrote that down properly?
I have tried something like:
@averageDailySuccess = (Sum(IIF(@operation='D' AND @logDate > GetDate()-30, @successCount, 0)))/30
but It give an overall average over the last 30 days and not the average per delivery code. To get the average per delivery code, you would usually need to group by the delivery code and calculate the average for each group. This might not be possible within a single additional column expression - it may require additional steps or adjustments in how your data is queried or processed. But I am not sure about how to do this too





