How do I write Mapping nested aggregation in proper form if I keep it this way it throws an error stating nested aggregation is not allowed. IF(WildMatch(Forecast_Plant,'22','23') > 0 ,sum(Forecast_QTY*(FACTUAL_MATL_COST))+sum(Forecast_QTY*FACTUAL_MATL_OH_COST) +sum(Forecast_QTY*FACTUAL_RESOURCE_COST)+sum(Forecast_QTY*FACTUAL_OVERHEAD_COST) ) /sum(Forecast_QTY)
For me it doesn't look like a nested aggregation - at least not if all references are fields and not variables. It might be that there is any bracket missing or reverse too much and/or misplaced.
Beside of this you may shorten and/or optimize your expression, for example with something (simplified) like this: