I am trying to calculate trailing 4 week average with avg over using the below calculation. Currently I have
windowAvg({Total Units Shipped},[{reporting_week}ASC] ,0,4,[{warehouse_id}]) that I need to convert to avg over to use it as below
sumOver(ifelse({reporting_date} = maxOver({reporting_date}, [{reporting_week}], PRE_AGG), {qty}, 0), [{reporting_week}], PRE_AGG)/avgOver({trailing 4 week of shipping units})
Hi
you can try this.
But I get an aggregation mismatch error as my numerator is a LAC (sumOver(ifelse({reporting_date} = maxOver({reporting_date}, [{reporting_week}], PRE_AGG), {qty}, 0), [{reporting_week}], PRE_AGG))
Hi @ganihar,
It’s been awhile since last communication on this thread, were you able to find a work around for your case or did you have any remaining questions?
If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.
Thank you!