select * from qmd_distributorSalesRaw order by forecast_qty desc select * from qmd_lastYearSalesRaw where sku = select top 1 customerSKU from tbl_PRD_CustomerSkus cs where cs.skuId = and cs.customerType in ( 'DST', 'PDST' ) and cs.customerId = and cs.linkType = 'SKU' and cs.ownerId = and cs.fsl_tablecode = select top 1 customerSKU from tbl_PRD_CustomerSkus cs inner join tbl_CDR_Distributors pcdr on pcdr.cdr_recordId = cs.customerId and pcdr.ownerId = cs.ownerId and pcdr.fsl_tablecode = cs.fsl_tablecode inner join tbl_DST_Distributors pdst on pdst.dstId = pcdr.fsl_dstId inner join tbl_DST_Distributors dst on dst.dstParentCo = pdst.dstId inner join tbl_CDR_Distributors cdr on cdr.fsl_dstId = dst.dstId and cdr.ownerId = pcdr.ownerId and cdr.fsl_tablecode = pcdr.fsl_tablecode where cs.skuId = and cs.customerType = 'PDST' and cs.linkType = 'SKU' and cdr.cdr_recordId = and cdr.ownerId = and cdr.fsl_tablecode =
FY#_calendar2.TY.fiscalYear# YTD Sales By SKU
#lsDateFormat( _planStartDate )# through #lsDateFormat( _planEndDate )# as of #lsdateformat( _asOfDate )#
Code / Description TY #ucase( left( qmd_unitOfMeasure.unitOfMeasurePlural, 1 ))##lcase( right( qmd_unitOfMeasure.unitOfMeasurePlural, len( qmd_unitOfMeasure.unitOfMeasurePlural ) - 1 ) )# TY % Tot. LY #ucase( left( qmd_unitOfMeasure.unitOfMeasurePlural, 1 ))##lcase( right( qmd_unitOfMeasure.unitOfMeasurePlural, len( qmd_unitOfMeasure.unitOfMeasurePlural ) - 1 ) )# LY % Chg. TY Dollars TY Pct. Tot. LY Dollars LY Pct. Chg.
#htmleditformat( sku )# - #htmleditFormat( skuDesc )# #lsnumberformat( round( val( forecast_qty )))# 0#lsnumberformat( round( val( forecast_qty )/qtyTotal * 100 ), "(9)")#% #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
Total Sales #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