Home > Technical > Table Definitions > STATBUCKET

STATBUCKET

All processes which want to record statistics in tables such as STATITEM, STATDEPT, OPERATORSTATS and STOCKSTATS write an initial record to this table. StatisticsService.exe will read these records and update the final statistics table as required.

Column Type Description
INTQUEUENUM INT A number indicating which queue should process this record. This is determined from TRADUNIT.intQueueNum. It allows multi-threaded processing of data and/or multiple instances of StatisticsService to process the data.
CTRCODE BIGINT A unique number assigned by the system.
INTUPDATECODE INT When a new record is written this will be 0. When the record has been processed it will be assigned a number by the system.
DTMSTATDATE DATETIME The date the record was written.
DTMPROCESSED DATETIME The date/time the record was processed.
STRSTORECODE VARCHAR(10) The location where the POS resides.
TRADUNIT.strTradeCode 
LINTITEMNUMBER INT The item to which the statistics belong. If the statistics are not related to a specific item, this can be left as 0.
ITEM.lintItemNumber
STRDEPTCODE VARCHAR(10) The department, if any, to which the statistics belong.
DEPT.strDeptCode
STRCATCODE VARCHAR(10) The category, if any, to which the statistics belong.
CATEGORY.strCatCode
STRGROUPCODE VARCHAR(10) The group, if any, to which the statistics belong.
GROUPS.strGroupCode
STRSUBGROUPCODE VARCHAR(10) The subgroup, if any, to which the statistics belong.
SUBGROUP.strSubGroupCode
STRMANUFACTURER VARCHAR(10) The manufacturer, if any, to which the statistics belong.
SUPPLIER.strSupplierCode
STRORDERCODE VARCHAR(20) The order code of the item, if any, to which the statistics belong.
STRPROMOTYPE VARCHAR(10) The promotion type, if any, to which the statistics belong.
INTTRIPID INT The trip id, if any, to which the statistics belong.
STRVALUE1 VARCHAR(25) The actual column name within the table that needs to be updated, for example curSales. The strSource field enables the system to determine the table which will be updated. The strValue2 to strValue20 fields below work the same way.
DBLVALUE1 DECIMAL(19,4) The value corresponding to strValue1. The dblValue2 to dblValue20 fields below work the same way.
STRVALUE2 VARCHAR(25)

 

DBLVALUE2 DECIMAL(19,4)

 

STRVALUE3 VARCHAR(25)

 

DBLVALUE3 DECIMAL(19,4)

 

STRVALUE4 VARCHAR(25)

 

DBLVALUE4 DECIMAL(19,4)

 

STRVALUE5 VARCHAR(25)

 

DBLVALUE5 DECIMAL(19,4)

 

STRVALUE6 VARCHAR(25)

 

DBLVALUE6 DECIMAL(19,4)

 

STRVALUE7 VARCHAR(25)

 

DBLVALUE7 DECIMAL(19,4)

 

STRVALUE8 VARCHAR(25)

 

DBLVALUE8 DECIMAL(19,4)

 

STRVALUE9 VARCHAR(25)

 

DBLVALUE9 DECIMAL(19,4)

 

STRVALUE10 VARCHAR(25)

 

DBLVALUE10 DECIMAL(19,4)

 

STRVALUE11 VARCHAR(25)

 

DBLVALUE11 DECIMAL(19,4)

 

STRVALUE12 VARCHAR(25)

 

DBLVALUE12 DECIMAL(19,4)

 

STRVALUE13 VARCHAR(25)

 

DBLVALUE13 DECIMAL(19,4)

 

STRVALUE14 VARCHAR(25)

 

DBLVALUE14 DECIMAL(19,4)

 

STRVALUE15 VARCHAR(25)

 

DBLVALUE15 DECIMAL(19,4)

 

STRVALUE16 VARCHAR(25)

 

DBLVALUE16 DECIMAL(19,4)

 

STRVALUE17 VARCHAR(25)

 

DBLVALUE17 DECIMAL(19,4)

 

STRVALUE18 VARCHAR(25)

 

DBLVALUE18 DECIMAL(19,4)

 

STRVALUE19 VARCHAR(25)

 

DBLVALUE19 DECIMAL(19,4)

 

STRVALUE20 VARCHAR(25)

 

DBLVALUE20 DECIMAL(19,4)

 

YSNUPDATE VARCHAR(1) If 'T' the system will generate an SQL UPDATE statement that does an update of the value, for example CURSALES=CURSALES+:CURSALES. If 'F' the system will generate a statement than does a replacement of the value, for example CURSALES = :CURSALES.
YSNEXPAND VARCHAR(1) If 'T' the system will take the lintItemNumber and automatically expand it so that statistics are recorded at the location, department, category and group levels. If this is 'F' a record will only be written for the specific details provided in this record.
STRSOURCE VARCHAR(5) Indicates the process which wrote the record. for example PO would indicate Purchase Order. It can also indicate specific type of data that needs to be updated. For example, a POS transaction will write a record with strSource of POS. But it will also write records for CUST and OP.

Additional source types:

OP, OP1, OP2, OP3   Operator statistics
STKST   Stock statistics
CUST   Customer counts
LINTREFERENCE BIGINT The reference number of the transaction that wrote the record. If strSource was 'IM', this would be the invoice number.
INTOPERATORID INT The user number, if any, to which the statistics belong.
USERCODE.intUserCode
STRSUPPLIERCODE VARCHAR(10) The supplier, if any, to which these statistics belong.
SUPPLIER.strSupplierCode

STRROUTECODE

VARCHAR(10)

The route to which these statistics belong.

INTSHIFTCODE

INTEGER

The shift to which this stats record belongs.

SHIFTCODE.intCode

INTSALESMETHOD

INTEGER

The sales method to which this stats record belongs.

SALESMETHOD.intCode

STRTABLE

VARCHAR(20)

The table to which the transaction belonged.

 

Primary Key: INTQUEUENUM + CTRCODE 

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)