Calculate moving average based on 2 categorical columns and on combined data
I have a dataset with mean Dozens of eggs per OrderId and OrderDate for Trial (Before, After) and TrialWeek (1, 2, 3, 4, 5). I would like to use the Moving Average function to calculate the mean Dozens at the end of every week, using the data from the previous weeks, and then input this number into a new column. So there should be repeated mean dozens for every row that have the same Trial and Tri...