Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends,
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)
*ApplyMap('map_conver_rate',DayStart(Date([ShipDate])),1),
(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) as TL
Thanks,
D
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:
(sum(Forecast_QTY) * Factor1 * Factor2 *) / sum(Forecast_QTY) * if(condition(applymap(), 1)
- Marcus