Sales Percentage - report help

Jul 09, 2010 2 Replies

I am novice trying to setup a report, shown below is the requirements. Any help will be appreciated.



//--- Report Summary --- //



//--- In prequery1, I wanted to take total of quantity(WAREHOUSE QTY) for each ITEMLOOKUPCODE and store it somewhere for calculation and print in the report ---//



//-- In the TablesQueried, I wanted to find total of sales(SALE QTY) from store for the same ITEMLOOKUPCODE, then calcuate & print the %age of sale Sort the % age in ascending order in the final report--//



PreQuery1 = "SELECT ITEMLOOKUPCODE, (SUM(QUANTITY)) FROM VIEWITEMMOVEMENT WHERE (QUANTITY > 0) AND (STORENAME = 'WareHouse') GROUP BY STORENAME, ITEMLOOKUPCODE"



PreQuery2 = "" TablesQueried = "FROM Item LEFT JOIN TransactionEntry WITH(NOLOCK) ON Item.ID = TransactionEntry.ItemID LEFT JOIN [Transaction] WITH(NOLOCK) ON ((TransactionEntry.TransactionNumber = [Transaction].TransactionNumber) AND (TransactionEntry.StoreID = [Transaction].StoreID)) LEFT JOIN Store WITH(NOLOCK) ON TransactionEntry.StoreID = Store.ID"



GroupBy = "Item.ItemLookupCode, Store.Name, TransactionEntry.Quantity" SortOrder = "Item.ItemLookupCode, Store.Name" SelCriteria = ""



End ReportSummary



//--- Title Rows ---//


Anyone wanted to bid on this job. Please do.

the information you need is already stored in the ItemDynamic table. Use your ItemMovementHistory report and add

ItemDynamic.SnapshotQuantity AS WhsQty,

to the SELECT statements,

LEFT JOIN ItemDynamic WITH(NOLOCK) ON Item.ID=ItemDynamic.ItemID and ItemDynamic.Storeid™

to the FROM statments (substitute your warehouse storeID where it says Storeid™) then add the column:

Begin Column FieldName = "ViewItemMovement.WhsQty" DrillDownFieldName = "" DrillDownReportName = "" StoreIDFieldName = "" Title = "WH Qty" VBDataType = vbDouble Formula = "" ColHidden = False ColNotDisplayable = False FilterDisabled = False ColWidth = 1080 GroupMethod = groupmethodNone ColFormat = "#.##" End Column

begin 666 Memorized-Item Movement History .qrp M+R\M+2T@4F5P;W)T(%-U;6UA51R86YS9F5R3&]G+D1A M=&54

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required