EEE SummarySales table definition
From EnablerWiki
Created: 21 July 2009. Last Reviewed: 21 July 2009
Below is the structure of the SummarySales table and an explanation of where each field comes from.
Structure of SummarySales
| | Field Name/Definition | Populated From |
| | BranchCode TBranchCode, | SaleLine.BranchCode |
| | ProductCode TProductCode, | SaleLine.ProductCode |
| | CountryCode TRegionCode NULL, | Branch.CountryCode |
| | State TState NULL, | Branch.State |
| | RegionCode TRegionCode NULL, | Branch.RegionCode |
| | SubregionCode TRegionCode NULL, | Branch.SubregionCode |
| | StoreName TDescription NULL, | Branch.Description |
| | Anal1 TAnalysisCode NULL, | Product.Analysis1Code |
| | Anal2 TAnalysisCode NULL, | Product.Analysis2Code |
| | Anal3 TAnalysisCode NULL, | Product.Analysis3Code |
| | Anal4 TAnalysisCode NULL, | Product.Analysis4Code |
| | Anal5 TAnalysisCode NULL, | Product.Analysis5Code |
| | Anal6 TAnalysisCode NULL, | Product.Analysis6Code |
| | Anal7 TAnalysisCode NULL, | Product.Analysis7Code |
| | Anal8 TAnalysisCode NULL, | Product.Analysis8Code |
| | Anal9 TAnalysisCode NULL, | Product.Analysis9Code |
| | Anal10 TAnalysisCode NULL, | Product.Analysis10Code |
| | Brand TAnalysisCode NULL, | Product.BrandCode |
| | StyleCode TAnalysisCode NULL, | Product.StyleCode |
| | ColourCode TAnalysisCode NULL, | Product.ColourCode |
| | SizeCode TAnalysisCode NULL, | Product.SizeCode |
| | StyleDescription TDescription NULL, | Style.Description |
| | ColourDescription TDescription NULL, | Colour.Description |
| | SizeDescription TDescription NULL, | Size.Description |
| | SupplierCode TSupplierCode NULL, | Product.Supplier1 |
| | SupplierName TName NULL, | Supplier.Name |
| | UnitsDay TQuantity NULL default 0, | Note 1 |
| | UnitsWTD TQuantity NULL default 0, | Note 2 |
| | UnitsLW TQuantity NULL default 0, | Note 3 |
| | UnitsW2 TQuantity NULL default 0, | Note 3 |
| | UnitsW3 TQuantity NULL default 0, | Note 3 |
| | UnitsW4 TQuantity NULL default 0, | Note 3 |
| | Units4WkAve TQuantity NULL default 0, | Note 4 (Computed Column) |
| | UnitCost Money NULL default 0, | Cost.BuyPrice1 – I.e. current list price for branch |
| | UnitWAC Money NULL default 0, | Cost.WAC – I.e. current WAC for the branch |
| | UnitSell Money NULL default 0, | Price.RetailPrice – I.e. current full selling price for branch |
| | TotalSalesDay Money NULL default 0, | Note 5 |
| | TotQtyDay | Note 6 |
| | TotSellDay | Note 6 |
| | TotQtyTot | Note 7 |
| | TotSellTot | Note 7 |
| | AveSellDay Money NULL default 0, | Note 6 (Computed Column) |
| | AveSellTot Money NULL default 0, | Note 7 (Computed Column) |
| | GPPercToday numeric(9,2) NULL default 0, | Note 8 (Computed Column) |
| | GPPercWTD numeric(9,2) NULL default 0, | Note 8 (Computed Column) |
| | GPPercLW numeric(9,2) NULL default 0, | Note 8 (Computed Column) |
| | GPPercTotal numeric(9,2) NULL default 0, | Note 8 (Computed Column) |
| | SOH TQuantity NULL default 0, | Note 9 |
| | SOHLayby TQuantity NULL default 0, | Note 10 |
| | LastSoldDate datetime NULL, | Note 11 |
| | LastRecvDate datetime NULL, | Note 12 |
| | SOHLW TQuantity NULL default 0, | Note 13 |
| | NetSalesDay Money NULL default 0, | Note 14 |
| | NetSalesWTD Money NULL default 0, | Note 14 |
| | NetSalesLW Money NULL default 0, | Note 14 |
| | NetSalesW2 Money NULL default 0, | Note 14 |
| | NetSalesW3 Money NULL default 0, | Note 14 |
| | NetSalesW4 Money NULL default 0, | Note 14 |
| | GPDay Money NULL default 0, | Note 15 |
| | GPWTD Money NULL default 0, | Note 15 |
| | GPLW Money NULL default 0, | Note 15 |
| | GPW2 Money NULL default 0, | Note 15 |
| | GPW3 Money NULL default 0, | Note 15 |
| | GPW4 Money NULL default 0 | Note 15 |
| | TransferInQtyDay TQuantity null default 0 | Note 16 |
| | TransferOutQtyDay TQuantity null default 0 | Note 16 |
| | CommittedPOQty TQuantity null default 0 | Note 17 |
| | UnCommittedPOQty TQuantity null default 0 | Note 18 |
| | InBoundStockQty TQuantity null default 0 | Note 19 |
| | SupplierStockCode TProduct NULL | Product.Supplier1Code |
| | UnitDutyFreePrice money NULL default 0 | Price.DutyFreePrice |
| | UnitsEver TQuantity NULL default 0 | Note 3 |
| | NetSalesEver Money NULL default 0 | Note 14 |
| | GPEver Money NULL default 0 | Note 15 |
| | GPPercEver | Note 8 (Computed Column) |
| | WeeksCover | Note 20 (Computed Column) |
| | FirstSoldDate datetime NULL, | Note 21 |
| | FirstRecvDate datetime NULL | Note 22 |
| | EarliestPODueDate datetime NULL | Note 23 |
| | LatestPODueDate datetime NULL | Note 23 |
| | WeeksSoldFor int NULL | Note 24 (Computed Column) |
| | SuperProduct bit NOT NULL DEFAULT 0 | Note 25 |
| | SubProduct bit NOT NULL DEFAULT 0 | Note 25 |
| | ProductDescription TDescription NULL | Product.Description |
Field Notes
Note 1
Sum of SaleLine.Quantity for all records for target date. I.e. units sold net of units returned.
Note 2
Sum of SaleLine.Quantity for all records for week to date (00:00:00 Sunday morning up until and including target date). I.e. units sold net of units returned.
Note 3
Sum of SaleLine.Quantity for all records for relevant week. I.e. units sold net of units returned.
Note 4
Calculated: (UnitsLW+UnitsW2+UnitsW3+UnitsW4) / 4
Note 5
Not Populated – Unused. Refer Field 49. Field 37 to be dropped in final version?
Note 6
Total units sold for the day, total sales value for the day. Use to calculate computed column AveSellDay – average selling price for the day which is sum of sales value for day divided by units sold for the day. Sales value is net of discounts and inclusive of GST and expressed in the local currency of the store. Only considers records with quantity > 0 (i.e. not returns).
Note 7
Total units sold for the entire period (i.e. 4 weeks plus current WTD), total sales value for entire period. Use to calculate computed column AveSellTot – average selling price for the period which is sum of sales value for period divided by units sold for the period. Sales value is net of discounts and inclusive of GST and expressed in the local currency of the store. Only considers records with quantity > 0 (i.e. not returns).
Note 8
Gross Profit for the period* divided by Net sales for the day. Gross Profit and Net Sales defined later in notes 14 & 15.
* Period is the day, WTD, LW etc according to the specific field.
Note 9
Total units on hand – includes stock available for sale AND stock reserved for laybys. Sum of Inventory.Quantity for ProductCode/BranchCode.
Note 10
Stock units in layby stock bin – i.e. depending on configuration this should equate to number of units currently on layby. Populated from Inventory.Quantity for ProductCode/BranchCode and StockLocationCode=’LAYBY’ rather than from layby tables. ‘LAYBY’ can be customised to suit configuration via the @lbbin variable defined at the beginning of the stored procedure.
Note 11
Date/time of the most recent sale assuming this sale occurred within the 4.x week period analysed in the summary table. Otherwise NULL. Max(SaleLine.SaleDate) for ProductCode/BranchCode.
Note 12
Date/time of most recent stock receipt of the product at the branch, regardless of how long ago this occurred. Max(StockMovement.Date) where Type = 2 (Goods Receipt) or Type = 4 (Stock Transfer) and where goods movement was inwards / positive.
Note 13
Total stock on hand as at end of last week including stock in layby bin. Calculated by adjusting current SOH (field 44) by net stock movements this week to date.
Note 14
Net sales for the period* is defined as the sale amount net of discounts, exclusive of GST and expressed in the local currency of the store making the sale. These fields are used in the GP percentage calculations.
* Period is the day, WTD, LW etc according to the specific field.
Note 15
GP for the period* is the dollar amount of gross profit as calculated at POS and uploaded to H/O. Therefore depends on stores being correctly configured to use WAC for GP calculations and depends on store databases being correctly populated with WAC. GP is expressed in the local currency of the store making the sale.
* Period is the day, WTD, LW etc according to the specific field.
Note 16
Quantity transferred in/out for target date. This is the sum of StockLed.Quantity for transaction types 4 (transfers) and 8 (transfers). Transfer in/out is determined by the sign of the quantity (negative quantity is a transfer out). Note that transfer outs may result from Head Office EEE transfers out, Head Office EEE Replenishments, or Head Office EEE Manual Stock Distributions.
Note 17
Quantity on committed purchase orders. This purchase orders may be Store-generated purchase orders or central purchase orders (ie generated by Head Office on behalf of stores).
For purchase orders which are to be delivered to the warehouse (without store distribution) they are counted in the totals for the warehouse branch. For purchase orders which are to be delivered to the warehouse (with store distribution) and purchase orders which are to be delieved direct to stores, the quantities are tabulated according to the final destination branch, ie not the warehouse.
Note 18
Quantity on uncommitted, centralised purchase orders. Typically, these are purchase orders that are still in the process of being created/edited before being committed and sent to suppliers. For purchase orders which are to be delivered to the warehouse (without store distribution) they are counted in the totals for the warehouse branch. For purchase orders which are to be delivered to the warehouse (with store distribution) and purchase orders which are to be delieved direct to stores, the quantities are tabulated according to the final destination branch, ie not the warehouse.
Note 19
Quantity of stock which has been transferred out from another store or Head Office and which is in transit to the store tabulated. Note that this will not include stock inbound directly from suppliers, resulting from central purchase orders. It will include: stock from Head Office EEE replenishments, Head Office EEE manual stock distributions, and Head Office EEE transfers.
Note 20
Weeks cover = SOH / (UnitsLW+UnitsW2+UnitsW3+UnitsW4) * 4, Rounded to the nearest week. Set to 9999 if no units sold in last four weeks, or if formula produces a result > 9999. Set to zero if there is zero (or negative) stock.
Note 21
Date/time of the first ever sale. Otherwise NULL. MIN(SaleLine.SaleDate) for ProductCode/BranchCode.
Note 22
Date/time of first ever stock receipt of the product at the branch, regardless of how long ago this occurred. MIN(StockMovement.Date) where Type = 2 (Goods Receipt) or Type = 4 (Stock Transfer) and where goods movement was inwards / positive.
Note 23
Date/time of the nearest future delivery due date on products within EEE central purchase orders (or furthest into the future). Note that a purchase order of delivery type to warehouse with distribution will be tabulated according to the branches in the distribution rather than the warehouse. Only components of purchase orders which are outstanding are considered.
Note 24
Number of weeks since first sale of the product at the branch, rounded to the nearest week.
Note 25
A SuperProduct is a product which is sold as a kit, or as a multi-pack. A SubProduct is one which can be sold as a component of a kit or is an item within a multi-pack. This is determined as follows: Products which are in KitDefinition.KitProductCode are SuperProducts, and those which are in KitDefinition.ComponentProductCode are SubProducts.
Magenta / EEE Internal SQL Data Types
TRegionCodevarchar(20)
TStatechar(5)
TAnalysisCodevarchar(20)
TDescriptionvarchar(60)
TNamevarchar(60)
TProductCodevarchar(25)
TBranchcodevarchar(20)
TQuantitynumeric(12,6)
TSupplierCodevarchar(20)