CONSUMER COVERAGE AUTOMATION REPORT
Process Overview
| Field | Details |
|---|---|
| Process Name | Consumer Coverage Automation |
| Segment | GSC – Global Supply Chain |
| Process Family | Lenovo India |
| Process Users | Wyzmindz Solutions Pvt Ltd |
| Process Purpose | The automation reads the AP Data Dump, filters the required Consumer segment, maps fields, applies Bill_Blog and Brand rules, enriches city attributes, derives Disty/Non-Disty and CA, maps Order Week from the ROL Calendar, and exports a formatted workbook. |
Version History
| Version Tag | Prepared By | Date of Update | Validated By | Reviewed By | Approved By | Revision Details |
|---|---|---|---|---|---|---|
| V 1.0 | Sharanya J | 22-12-2025 | Navneeth | Sushruth Vasista | Vishwanath Mosale | SOP Document Creation |
Distribution & Access List
| Designation | Read | Write | Approval |
|---|---|---|---|
| Analyst | Yes | No | No |
| Team Lead | Yes | Yes | No |
| Manager | Yes | Yes | Yes |
1.1 Purpose and Scope
Create a standardized Consumer Coverage workbook from AP data and reference files. Update file paths and quarter input in the script before each run.
1.2 Source-to-Output Mapping
| Output Column | Source / Rule |
|---|---|
| Bill_Blog | Calculated from Develiery Plant + Data Type |
| Billing_Doc / SO_No | Billing Number / Sales No |
| Billing_Type / Order_Creation_Date | Doc Type / Order Date |
| Payer_Code | As configured in current COLUMN_MAP |
| Disty / Disty/Non-Disty | Sold To Customer Name / derived rule |
| MTM / Description / Quantity | Material / Material Dec / Volume |
| CA | Quantity for configured brands DESKTOP, NOTEBOOK, MOBILE WS, SMO, THINK STATION; otherwise 0 |
| Plant / Material_Group | Develiery Plant / Sub Brand |
| Brand | MTM Master lookup: coverage MTM → Material → Brand |
| Transaction / Series | Product Group / Mktg Name |
| Special_Bid_No / Customer_PO_No | Contract Number / Customer Po Number |
| Ship_to_City | Ship to City |
| State / Territory / Region | City Mapping lookup using Ship_to_City → CityCorrect |
| AWB_Number / Shipping_Condition | Ext Bol No / Shipping Type |
| Line_Item_No / Billing_Date | SO# Item / Billing Doc. Date |
| Net_Value / Distribution_Channel | Local Total Price / Channel Code |
| creditreleasedate / backlogtype | Credit Release Date / Backlog Type |
| ORDER WEEK | ROL Calendar SI: QTR-filtered Date → Week; unmatched → OB |
1.3 Business Rules
| Rule | Logic |
|---|---|
| Input segment | Filter AP Data Dump to Segment = Consumer before mapping/building coverage. |
| Bill_Blog | H002 + BACKLOG → ZD BLOG; H002 + SHIP → ZD BILL; other plants + BACKLOG → FD BLOG; other plants + SHIP → FD BILL; other values blank. |
| Brand lookup/filter | Lookup MTM against MTM Master Material and return Brand; retain the six approved Consumer brands only. |
| Disty/Non-Disty | Disty equal to ONE TIME CUSTOMER → Non-Disty; everything else → Disty. |
| City lookup | Ship_to_City → CityCorrect → return State, Territory and Region. |
| Order Week | Read ROL Calendar sheet SI; filter QTR (e.g. Q2/2026); normalize dates before matching; return Week; unmatched values are OB. |
| Dates and numeric fields | Apply the configured short-date and numeric/delimiter formatting; preserve identifier zeros and Net Value precision. |
1.4 Configuration and Dependencies
AP_PATH = r"...\AP Data Dump ..."
OUTPUT_PATH = r"...\Consumer_Coverage.xlsx"
MTM_MASTER_PATH = r"...\MTM Master.xlsx"
CITY_MAPPING_PATH = r"...\City Mapping.xlsx"
ROL_CALENDAR_PATH = r"...\ROL Calendar.xlsx"
ORDER_WEEK_QTR = input("Enter QTR (e.g. Q2/2026): ")
- Python, pandas, openpyxl; pyxlsb for XLSB files.
- MTM Master requires Material and Brand.
- City Mapping requires CityCorrect, State, Territory and Region.
- ROL Calendar sheet SI requires QTR, Date and Week.
1.5 Process Flow
- Start → validate paths and read AP Data Dump.
- Filter AP Segment to Consumer before building coverage.
- Build output columns from COLUMN_MAP.
- Calculate Bill_Blog; map Brand and filter approved brands.
- Calculate Disty/Non-Disty and CA; map city attributes.
- Filter ROL Calendar by QTR and map Order Week; unmatched → OB.
- Format dates/numeric fields and write Excel output.
- End → validate output before sharing.
1.6 Run Procedure
- Confirm AP Data Dump, MTM Master, City Mapping and ROL Calendar are current.
- Verify configured paths and output location.
- Confirm the SI sheet and QTR value for Order Week.
- Close the output workbook if it is open.
- Run in VS Code terminal:
python your_script_name.py. - Review warnings and completion counts.
- Open the workbook and complete the validation checklist.
1.7 Detailed Logic
Bill_Blog
Normalize Plant and Data Type by trimming spaces and uppercasing. H002 BACKLOG becomes ZD BLOG; H002 SHIP/SHIPS becomes ZD BILL. Non-H002 BACKLOG becomes FD BLOG; non-H002 SHIP/SHIPS becomes FD BILL.
Brand Lookup and Filtering
Coverage MTM is matched against MTM Master Material and the Brand is returned. Keep DESKTOP, NOTEBOOK, OPTIONS, SERVICES, VISUALS and VISUALS STANDALONE; discard other rows.
City Lookup
Ship_to_City is copied directly from AP. The normalized city is matched against CityCorrect and returns State, Territory and Region. Unmatched cities remain blank.
Order Week
Read the SI sheet using the correct header row, filter QTR to the entered quarter, normalize both calendar and order-creation dates to the same date key, and return Week. If no match is found, use OB. Do not compare date strings directly with datetime objects.
Excel Formatting
The writer applies the established Consumer Coverage header style, filter dropdowns, frozen header row, suitable column widths, short-date display and configured numeric/delimiter formatting.
1.8 Validation Checklist
- AP rows were filtered to Consumer before coverage construction.
- Bill_Blog labels match Plant and Data Type.
- Brand contains only approved Consumer brands.
- Disty/Non-Disty and CA rules are correct.
- City fields match City Mapping.
- ORDER WEEK matches the selected quarter; unmatched dates show OB.
- Dates display in the agreed short-date format.
- Identifiers and financial values retain required zeros/precision.
- Output path, row count, filters and frozen header are correct.
1.9 Troubleshooting
| Symptom | Action |
|---|---|
| AP file missing | Check AP_PATH, filename, extension and folder access. |
| Missing source column | Check header spelling and whitespace; compare with COLUMN_MAP. |
| Brand blank / unexpected rows removed | Check MTM-to-Material lookup and approved Brand labels. |
| ORDER WEEK unexpectedly OB | Check SI sheet, QTR filter, header row, date normalization and Week column. |
| Length mismatch after filtering | Filter AP before creating coverage, or filter coverage consistently; avoid assigning full-length AP results to a shorter dataframe. |
| Dates appear as serial numbers | Use actual datetime values and set Excel number_format. |
| PermissionError | Close the output file and check folder permissions. |
Appendix – Quick Run Checklist
- Verify all input files and paths.
- Enter correct Order Week quarter.
- Run script and review warnings.
- Validate Brand, Bill_Blog, CA, city lookups and Order Week.
- Check dates, numeric values and row counts before sharing.