select i.plan_period, i.fseTerritoryId, t.internalSalesId, t.name territoryName, i.fseBgtCatId, oa.attrDescription, sum( plan_eus / fseEUFactor ) caseAmt, avg( fseUnitPrice ) avgCasePrice from tbl_IMPORT_Smuckers_CustomerBudgets i inner join tbl_TER_Territories t on t.territoryId = i.fseTerritoryId and t.ownerId = i.ownerId and t.fsl_tablecode = i.ownerType inner join tbl_ORG_Attributes oa on oa.ownerId = i.ownerId and oa.fsl_tablecode = i.ownerType and oa.attrId = i.fseBgtCatid where i.eai_batchId = and i.fseBgtCatId > 0 and i.fseTerritoryId in ( select ter.territoryId from tbl_TER_Territories ter inner join tbl_TER_TerritoryLevels lvl on lvl.levelId = ter.levelId where ter.ownerId = and ter.fsl_tablecode = and lvl.brokerLevel = 1 and lvl.businessPlanReviewCycle = 'Y' ) and i.fseProcessed = 'Y' group by i.plan_period, i.fseTerritoryId, i.fseBgtCatId, t.internalSalesId, t.name, oa.attrDescription order by internalSalesId, oa.attrDescription, plan_period select item_nbr, count(*) lineCount, sum(plan_eus) plan_eus from tbl_IMPORT_Smuckers_CustomerBudgets where fseSkuId is null and eai_batchId = group by item_nbr order by lineCount desc select cust_id, count(*) lineCount, sum( plan_eus / fseEUFactor ) caseAmt from tbl_IMPORT_Smuckers_CustomerBudgets where fseCDR_recordId is null and eai_batchId = group by cust_id order by lineCount desc
Unknown SKUs#lsnumberformat( qmd_unknownSKUs.recordCount)#
Unknown Customers#lsnumberformat( qmd_unknownCustomers.recordCount)#
#htmleditformat( _calendar.TY.y1.name )# (#lsdateFormat( _calendar.TY.fiscalStartDate, "MM/DD/YYYY" )# - #lsdateFormat( _calendar.TY.fiscalEndDate, "MM/DD/YYYY" )#)
Territory
Category
#rereplace( _calendar.ty.periods[_p].name, "\s", "
", "ALL" )#
#htmleditformat( internalSalesId )# - #htmleditformat( territoryName )#
#htmleditformat( attrDescription )# na#lsnumberformat( caseAmt )# na
Unknown SKUs (#qmd_unknownSKUs.recordCount#)
item_nbrline countplan eus (sum)
#htmleditformat( item_nbr )##lsnumberformat( lineCount )##lsnumberformat( plan_eus )#
Unknown Customers (#qmd_unknownCustomers.recordCount#)
cust_idline countCase Amount
#htmleditformat( cust_id )##lsnumberformat( lineCount )##lsnumberformat( caseAmt )#