select max( convert( datetime, tpf.forecast_year + '-' + tpf.forecast_month + '-1' )) lastActualsDate from tbl_MFR_TPF_Detail#_tpfSuffix# tpf inner join ( select max( convert( int, forecast_year )) maxYear from tbl_MFR_TPF_Detail#_tpfSuffix# tpf where tpf.mfr_id = and tpf.tpartnerType = 'CDR' and tpf.forecast_status = 'A' and tpf.forecast_qty <> 0) tpf2 on tpf2.maxYear = convert( int, tpf.forecast_year ) where tpf.mfr_id = and tpf.tpartnerType = 'CDR' and tpf.forecast_status = 'A' and tpf.forecast_qty <> 0 group by tpf.forecast_year select startYear, startMonth, endYear, endMonth from tbl_TER_BusinessPlans bp where territoryId = 0 and ownerId = and ownerType = and timeframePeriod = 'Y01'

Sales Summary for #_planYear#

#lsDateFormat( _planStartDate )# through #lsDateFormat( _planEndDate )# as of #lsdateformat( dateadd( "d", -1, dateadd( "m", 1, lastActualsDate )))#
select * from qmd_lastYearSalesRaw where mktCategoryId = and mktSubCategoryId = select * from qmd_lastYearSalesDetail where sku = select * from qmd_lastYearSalesRaw where mktCategoryId is null and mktSubCategoryId is null select * from qmd_lastYearSalesDetail where sku =
Category / SubCategory TY Cases TY Pct. Tot. LY Cases LY Pct. Chg. TY Dollars TY Pct. Tot. LY Dollars LY Pct. Chg.
#filterLabel# &##160; &##160;
#attrDescription# #listfirst( lsnumberformat( val( forecast_qty )), "." )# #lsnumberformat( round( val( forecast_qty )/qtyTotal*100 ), "(9)")#%na #listfirst( lsnumberformat( val( qmd_lastYearSales.forecast_qty )), "." )# #lsnumberformat( round( lyChange/val( qmd_lastYearSales.forecast_qty )*100 ), "(9)")#% na #rereplace( lscurrencyFormat( val( forecast_amt )), "\.\d*", "" )# #lsnumberformat( round( val( forecast_amt )/amtTotal*100 ), "(9)")#%na #rereplace( lscurrencyformat( val( qmd_lastYearSales.forecast_amt )), "\.\d*", "")# #lsnumberformat( round( lyChange/val( qmd_lastYearSales.forecast_amt )*100 ), "(9)")#% na
#sku# #skuDesc# #listfirst( lsnumberformat( val( forecast_qty )), "." )# #lsnumberformat( round( val( forecast_qty )/_tyTotalQty * 100 ), "(9)")#% #val( qmd_lySkuDetail.forecast_qty)# #lsnumberformat( round( lyChange/val( qmd_lySkuDetail.forecast_qty )*100 ), "(9)")#% na #rereplace( lscurrencyformat( val( forecast_amt )), "\.\d*", "" )# #lsnumberformat( round( val( forecast_amt )/_tyTotalAmt * 100 ), "(9)")#% #rereplace( lscurrencyformat( val( qmd_lySkuDetail.forecast_amt )), "\.\d*", "" )# #lsnumberformat( round( lyChange/val( qmd_lySkuDetail.forecast_amt )*100 ), "(9)")#% na
All Other #listfirst( lsnumberformat( val( forecast_qty )), "." )# #lsnumberformat( round( val( forecast_qty )/qtyTotal*100 ), "(9)")#%na #listfirst( lsnumberformat( val( qmd_lastYearSales.forecast_qty )), "." )# #lsnumberformat( round( lyChange/val( qmd_lastYearSales.forecast_qty )*100 ), "(9)")#% na #rereplace( lscurrencyFormat( val( forecast_amt ) ), "\.\d*", "" )# #lsnumberformat( round( val( forecast_amt )/amtTotal*100 ), "(9)")#%na #rereplace( lscurrencyformat( val( qmd_lastYearSales.forecast_amt )), "\.\d*", "" )# #lsnumberformat( round( lyChange/val( qmd_lastYearSales.forecast_amt )*100 ), "(9)")#% na
#sku# #skuDesc# #listfirst( lsnumberformat( val( forecast_qty )), "." )# #lsnumberformat( round( val( forecast_qty )/_tyTotalQty * 100 ), "(9)")#% #val( qmd_lySkuDetail.forecast_qty)# #lsnumberformat( round( lyChange/val( qmd_lySkuDetail.forecast_qty )*100 ), "(9)")#% na #rereplace( lscurrencyformat( val( forecast_amt )), "\.\d*", "")# #lsnumberformat( round( val( forecast_amt )/_tyTotalAmt * 100 ), "(9)")#% #rereplace( lscurrencyformat( val( qmd_lySkuDetail.forecast_amt )), "\.\d*", "")# #lsnumberformat( round( lyChange/val( qmd_lySkuDetail.forecast_amt )*100 ), "(9)")#% na
Totals #listfirst( lsnumberformat( qtyTotal ), "." )# #listfirst( lsnumberformat( lyQtyTotal ), "." )# #lsnumberformat( round( lyChange/val( lyQtyTotal )*100 ), "(9)")#% na #rereplace( lscurrencyFormat( amtTotal ), "\.\d*", "")# #rereplace( lscurrencyFormat( lyAmtTotal ), "\.\d*", "" )# #lsnumberformat( round( lyChange/val( lyAmtTotal )*100 ), "(9)")#% na