tables · table
monthwisesale
The monthwisesale table serves as a flattened reporting structure within the SQL Server environment, designed to track and display sales performance on a monthly basis across a fiscal or calendar year. It aggregates sales data per unique combination of Company, Customer, and Item. This table is primarily utilized for generating "Sales by Month" pivot-style reports and trend analysis.
Row count
17
Last entry
—
Source
tables
Columns
20| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | INT | NO | Primary key for the record. |
compcode | VARCHAR | YES | The unique identifier for the company/branch. |
custcode | VARCHAR | YES | Unique identifier for the customer. |
itemcode | VARCHAR | YES | Unique internal identifier for the product. |
month1 | DECIMAL | YES | Sales quantity/value for the 1st month of the period. |
month2 | DECIMAL | YES | Sales quantity/value for the 2nd month of the period. |
month3 | DECIMAL | YES | Sales quantity/value for the 3rd month of the period. |
month4 | DECIMAL | YES | Sales quantity/value for the 4th month of the period. |
month5 | DECIMAL | YES | Sales quantity/value for the 5th month of the period. |
month6 | DECIMAL | YES | Sales quantity/value for the 6th month of the period. |
month7 | DECIMAL | YES | Sales quantity/value for the 7th month of the period. |
month8 | DECIMAL | YES | Sales quantity/value for the 8th month of the period. |
month9 | DECIMAL | YES | Sales quantity/value for the 9th month of the period. |
month10 | DECIMAL | YES | Sales quantity/value for the 10th month of the period. |
month11 | DECIMAL | YES | Sales quantity/value for the 11th month of the period. |
month12 | DECIMAL | YES | Sales quantity/value for the 12th month of the period. |
total | VARCHAR | YES | Calculated total sales for the 12-month period. |
taverage | VARCHAR | YES | Calculated average monthly sales. |
itemname | VARCHAR | YES | Descriptive name of the item. |
partno | VARCHAR | YES | Manufacturer or customer part number. |
Full documentation
### 1. Overview The `monthwisesale` table serves as a flattened reporting structure within the SQL Server environment, designed to track and display sales performance on a monthly basis across a fiscal or calendar year. It aggregates sales data per unique combination of Company, Customer, and Item. This table is primarily utilized for generating "Sales by Month" pivot-style reports and trend analysis. ### 2. Column dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | INT | NO | Primary key for the record. | Auto-incrementing integers. | Primary Key | | **compcode** | VARCHAR | YES | The unique identifier for the company/branch. | e.g., 'DAS' | Join Key | | **custcode** | VARCHAR | YES | Unique identifier for the customer. | e.g., 'AGIPL', 'BIL' | Join Key | | **itemcode** | VARCHAR | YES | Unique internal identifier for the product. | e.g., 'AGIPLAAZA' | Join Key | | **month1** | DECIMAL | YES | Sales quantity/value for the 1st month of the period. | Numeric values | Aggregate/Report | | **month2** | DECIMAL | YES | Sales quantity/value for the 2nd month of the period. | Numeric values | Aggregate/Report | | **month3** | DECIMAL | YES | Sales quantity/value for the 3rd month of the period. | Numeric values | Aggregate/Report | | **month4** | DECIMAL | YES | Sales quantity/value for the 4th month of the period. | Numeric values | Aggregate/Report | | **month5** | DECIMAL | YES | Sales quantity/value for the 5th month of the period. | Numeric values | Aggregate/Report | | **month6** | DECIMAL | YES | Sales quantity/value for the 6th month of the period. | Numeric values | Aggregate/Report | | **month7** | DECIMAL | YES | Sales quantity/value for the 7th month of the period. | Numeric values | Aggregate/Report | | **month8** | DECIMAL | YES | Sales quantity/value for the 8th month of the period. | Numeric values | Aggregate/Report | | **month9** | DECIMAL | YES | Sales quantity/value for the 9th month of the period. | Numeric values | Aggregate/Report | | **month10** | DECIMAL | YES | Sales quantity/value for the 10th month of the period. | Numeric values | Aggregate/Report | | **month11** | DECIMAL | YES | Sales quantity/value for the 11th month of the period. | Numeric values | Aggregate/Report | | **month12** | DECIMAL | YES | Sales quantity/value for the 12th month of the period. | Numeric values | Aggregate/Report | | **total** | VARCHAR | YES | Calculated total sales for the 12-month period. | Numeric string | Aggregate/Report | | **taverage** | VARCHAR | YES | Calculated average monthly sales. | Numeric string | Aggregate/Report | | **itemname** | VARCHAR | YES | Descriptive name of the item. | | Display Only | | **partno** | VARCHAR | YES | Manufacturer or customer part number. | e.g., 'BOP-01-AAZA-0005' | Display Only | ### 3. Relationships & join map The `monthwisesale` table acts as a summary leaf node in the sales hierarchy, connecting to master data tables for descriptive information. #### Primary Joins * **Customer Master (`dbo.cust`):** Join on `compcode` and `custcode` to retrieve customer names, credit limits, and addresses. * **Item Master (`dbo.itemmas` or `dbo.saleitemmas`):** Join on `compcode` and `itemcode` to retrieve detailed item specifications, HSN codes, and unit of measures (UOM). #### Likely Transactional Links * **Sales Invoices (`dbo.invdtl`):** Logically related via `compcode`, `custcode`, and `itemcode`. This table is the likely source for calculating the monthly buckets in `monthwisesale`. * **Order Analysis (`dbo.oadtl`):** Joins via `compcode` and `itemcode` to compare actual monthly sales against scheduled quantities (plan vs. actual).