INDIA FUNNEL AUTOMATION REPORT
Process Overview
| Field | Details |
|---|---|
| Process Name | India Funnel Automation |
| Segment | REL |
| Process Family | Lenovo India |
| Process Users | Wyzmindz Solutions Pvt Ltd |
| Process Purpose | Automated preparation of the India funnel output from pipeline data and reference mapping workbooks. The automation converts the India pipeline source workbook into a standardized funnel output, retains only configured REL segments, derives DAAS, maps ownership fields, applies GAB/GTC overrides, derives RCD and RSM, and writes the final Excel output. |
Version History
| Version Tag | Prepared By | Date of Update | Validated By | Reviewed By | Approved By | Revision Details |
|---|---|---|---|---|---|---|
| V 1.0 | Wyzmindz | 08-10-2026 | — | Process Owner | Process Manager | SOP creation for India Funnel automation |
| V 1.1 | — | — | — | — | — | Future automation / mapping revisions |
Distribution & Access List
| Designation | Read | Write | Approval |
|---|---|---|---|
| Analyst | Yes | No | No |
| Team Lead | Yes | Yes | No |
| Manager | Yes | Yes | Yes |
1.1 Purpose
The purpose of this SOP is to define the standard procedure for running the India Funnel automation, preparing the pipeline data, applying REL segment filtering and ownership mappings, deriving DAAS / Region / Vertical / RCD / RSM fields, and generating the final Excel output. The SOP also documents the Python logic so that the process can be operated, validated and maintained consistently.
1.2 Scope
- Geographic Scope: India.
- Business Segment: REL.
- Core Activity: Generate a standardized India funnel output from the Data sheet and mapping workbooks.
- Source Data: India pipeline Excel workbook, sheet
Data. - Reference Data: Mapping workbook containing
Region&VerticalandRSM&RCDsheets. - Output: Excel workbook containing the filtered and mapped pipeline data.
1.3 Business / Segment Overview
- The source workbook contains pipeline opportunity/account information used for India funnel reporting.
- Only EA OL, GAB, GTC, Private Edu, Public, SA and SLBD are retained.
- DAAS is assigned when Solution Area equals "Device as a Service"; otherwise
-is assigned. - Field Sales is the first mapping path for Updated Opp Owner, New Region and Vertical.
- When Field Sales is blank and Field Manager is populated, the Field Manager mapping is used.
- When both Field Sales and Field Manager are blank, Updated Opp Owner, New Region and Vertical are set to
-. - GAB and GTC override New Region and Vertical with the segment value itself.
- RCD and RSM are derived by concatenating New Region + Vertical and looking up the result in the RSM&RCD mapping.
1.4 Responsibility and Authority
| Role | Name |
|---|---|
| Analyst | Sharanya J |
| Process Owner | Navaneeth |
| Process Manager | Dayanand |
| Approval Authority | Vishwanath Mosale |
1.5 Escalation Matrix
Escalation Matrix – WyzMindz Solutions Pvt Ltd (India)
| Sl. No | Name | Designation | Email ID |
|---|---|---|---|
| 1 | Sushruth Vasista | Manager | sushruth.vasista@wyzmindz.com |
| 2 | Vishwanath Mosale | Director | vishwanath.mosale@wyzmindz.com |
Escalation Matrix – Lenovo India Pvt Ltd
| Sl. No | Name | Designation | Email ID |
|---|---|---|---|
| 1 | T Renganathan | Sales Operations Head – Commercial | trenganathan@lenovo.com |
| 2 | Saurabh Agarwal | Ops Director | asaurabh@lenovo.com |
1.6 RACI Matrix
RACI – WyzMindz Solutions Pvt Ltd (India)
| Report / Process | Responsible | Accountable | Consultation | Informed |
|---|---|---|---|---|
| India Funnel | Sharanya J | Sharanya J | Navaneeth K | Lenovo India Pvt Ltd; Wyzmindz Solutions Pvt Ltd India. |
1.7 Access Required
- Read access to the India pipeline source workbook.
- Read/write access to the output folder.
- Access to the
Mapping-1787634732938.xlsxreference workbook. - Python environment with
pandasandopenpyxlinstalled. - MS Excel for final review of the output.
1.8 Overview of Tools
| Sl. No | Tool / Component | Purpose |
|---|---|---|
| 1 | Python | Runs the India Funnel automation. |
| 2 | Pandas | Reads Excel data, filters rows, creates lookups and transforms columns. |
| 3 | OpenPyXL / Excel engine | Supports XLSX workbook reading/writing through pandas. |
| 4 | Microsoft Excel | Used for source/reference checks and final output review. |
1.9 Legends and Mapping Rules
| Source Value / Rule | Output / Meaning |
|---|---|
| EA OL | Retained REL segment |
| GAB | Retained; New Region = GAB; Vertical = GAB |
| GTC | Retained; New Region = GTC; Vertical = GTC |
| Private Edu | Retained REL segment |
| Public | Retained REL segment |
| SA | Retained REL segment |
| SLBD | Retained REL segment |
| Solution Area = Device as a Service | DAAS = DAAS |
| Other Solution Area | DAAS = - |
| Both Field Sales and Field Manager blank | Updated Opp Owner / New Region / Vertical = - |
| RegionVertical | New Region + Vertical, with no separator |
1.10 Dependencies
IND PIPELINE.xlsxwith a sheet namedData.Mapping-1787634732938.xlsxwithRegion&VerticalandRSM&RCDsheets.- Correct file paths configured in the Python script.
- Required source columns present.
- Approved mapping values maintained in the reference workbook.
1.11 Schedule of Reporting
The automation is executed according to the India funnel reporting cycle. The operator should use the latest approved pipeline input and mapping workbook before each run.
1.12 Process Flow Chart
- START → Run Python India Funnel automation.
- Step 1: Read
Datasheet from input workbook. - Step 2: Detect header row and clean column names.
- Step 3: Filter configured REL segments.
- Step 4: Derive DAAS from Solution Area.
- Step 5: Load Region&Vertical mapping.
- Step 6: Map Field Sales → Owner / Region / Vertical.
- Step 7: Map Field Manager when Field Sales is blank.
- Step 8: Set
-when both ownership fields are blank. - Step 9: Override GAB/GTC Region and Vertical.
- Step 10: Build RegionVertical key.
- Step 11: Map RCD and RSM from RSM&RCD.
- Step 12: Replace unmatched RCD/RSM with
-. - Step 13: Remove temporary RegionVertical and save output.
- END → India Funnel automation completed.
1.13 Steps of Procedure
- Confirm the latest India pipeline workbook and
Mapping-1787634732938.xlsxare available. - Update
input_file,output_fileandmapping_fileif the source/output locations have changed. - Run the Python script from VS Code or Command Prompt.
- Read the
Datasheet using pandas. The script first triesheader=0and falls back toheader=1if Segment is not found. - Clean source column names by trimming leading/trailing spaces.
- Validate that the Segment column exists; stop with a clear error if it is not found.
- Retain only EA OL, GAB, GTC, Private Edu, Public, SA and SLBD.
- Standardize Solution Area and assign DAAS for "Device as a Service"; all other values receive
-. - Read the
Region&Verticalsheet usingheader=1and normalize Field Sales / Field Sales Email values. - Map Field Sales Email to Rationalised Field sales, Field Sales Region and Field Sales Vertical.
- For records where Field Sales is blank but Field Manager is populated, map Field Manager Email to Rationalised Field Manager, Field Manager Region and Field Manager Vertical.
- For records where both Field Sales and Field Manager are blank, set Updated Opp Owner, New Region and Vertical to
-. - For GAB and GTC, set New Region and Vertical equal to Segment.
- Create the temporary RegionVertical key by concatenating New Region and Vertical without a separator.
- Read the
RSM&RCDsheet usingheader=0and map RegionVertical to RCD and RSM_NEW. - Replace unmatched/blank RCD and RSM results with
-. - Remove the temporary RegionVertical column.
- Review the printed row count and segment counts, then open the generated output workbook.
- Validate output values and mapping completeness before downstream use.
1.14 Code Logic and Automation Details
The automation follows a controlled read → detect header → filter → classify → map → override → derive key → map RCD/RSM → clean → output sequence.
A. Input Configuration
input_file = r"C:\Users\W2625\Desktop\IND PIPELINE.xlsx"
output_file = r"C:\Users\W2625\Desktop\Funnel output\India Pipeline .xlsx"
mapping_file = r"C:\Users\W2625\Desktop\Mapping-1787634732938.xlsx"
These paths are the first values to verify before every new run. Change only the file locations when the source/output location changes.
B. Source Loading and Header Fallback
df = pd.read_excel(input_file, sheet_name="Data", header=0)
df.columns = df.columns.astype(str).str.strip()
if "Segment" not in df.columns:
df = pd.read_excel(input_file, sheet_name="Data", header=1)
df.columns = df.columns.astype(str).str.strip()
if "Segment" not in df.columns:
raise KeyError("Segment column not found in row 1 or row 2.")
The script first assumes Excel row 1 is the header. If Segment is not found, it retries using Excel row 2. This makes the input more tolerant of a one-row shift in the source layout.
C. REL Segment Filtering
rel_segments = [
"EA OL", "GAB", "GTC", "Private Edu",
"Public", "SA", "SLBD"
]
df["Segment"] = df["Segment"].astype(str).str.strip()
df = df[df["Segment"].isin(rel_segments)].copy()
Only the configured REL segments enter the final output. Any newly introduced business segment must be reviewed and added to the configured list only after business confirmation.
D. DAAS Derivation
df["Solution Area"] = df["Solution Area"].astype(str).str.strip()
df["DAAS"] = df["Solution Area"].apply(
lambda x: "DAAS" if x == "Device as a Service" else "-"
)
The DAAS flag is deterministic: an exact cleaned Solution Area value of Device as a Service produces DAAS; all other values produce a hyphen.
E. Region&Vertical Mapping Setup
mapping_df = pd.read_excel(
mapping_file,
sheet_name="Region&Vertical",
header=1
)
mapping_df.columns = mapping_df.columns.astype(str).str.strip()
The current approved mapping workbook uses Excel row 2 as the header for Region&Vertical, therefore pandas header=1 is used. If the workbook layout changes, the header position must be validated before rerunning.
F. Field Sales Mapping
field_sales_lookup = (
mapping_df[mapping_df["Field Sales"] != ""]
[["Field Sales Email",
"Rationalised Field sales",
"Field Sales Region",
"Field Sales Vertical"]]
.drop_duplicates(subset="Field Sales Email")
.set_index("Field Sales Email")
)
Field Sales Email is the lookup key. The three outputs are Rationalised Field sales → Updated Opp Owner, Field Sales Region → New Region and Field Sales Vertical → Vertical.
G. Field Manager Fallback Mapping
field_manager_rows = (
(
df["Field Sales"].isna()
| (df["Field Sales"].astype(str).str.strip() == "")
)
& (
df["Field Manager"].notna()
& (df["Field Manager"].astype(str).str.strip() != "")
)
)
field_manager_lookup = (
mapping_df[
["Field Manager Email",
"Rationalised Field Manager",
"Field Manager Region",
"Field Manager Vertical"]
]
.drop_duplicates(subset="Field Manager Email")
.set_index("Field Manager Email")
)
Field Manager is used only when Field Sales is blank and Field Manager is populated. This prevents the Field Manager mapping from overwriting a valid Field Sales mapping.
H. Both Ownership Fields Blank
both_blank = (
(
df["Field Sales"].isna()
| (df["Field Sales"].astype(str).str.strip() == "")
)
& (
df["Field Manager"].isna()
| (df["Field Manager"].astype(str).str.strip() == "")
)
)
df.loc[
both_blank,
["Updated Opp Owner", "New Region", "Vertical"]
] = "-"
When neither ownership source is available, the script explicitly marks the three derived ownership fields as - so the missing mapping remains visible.
I. GAB / GTC Override
gab_gtc = df["Segment"].isin(["GAB", "GTC"])
df.loc[gab_gtc, "New Region"] = df.loc[gab_gtc, "Segment"]
df.loc[gab_gtc, "Vertical"] = df.loc[gab_gtc, "Segment"]
GAB and GTC have a direct business rule that overrides mapped Region and Vertical with their own segment value.
J. RegionVertical Key
df["RegionVertical"] = (
df["New Region"].fillna("").astype(str).str.strip()
+ df["Vertical"].fillna("").astype(str).str.strip()
)
The key is built without a separator because the RSM&RCD reference sheet stores the combined key in the same format.
K. RSM & RCD Lookup
rsm_rcd_lookup = (
rsm_rcd_df[
["RegionVertical", "RCD", "RSM_NEW"]
]
.drop_duplicates(subset="RegionVertical")
.set_index("RegionVertical")
)
df["RCD"] = df["RegionVertical"].map(rsm_rcd_lookup["RCD"])
df["RSM"] = df["RegionVertical"].map(rsm_rcd_lookup["RSM_NEW"])
df["RCD"] = df["RCD"].fillna("-")
df["RSM"] = df["RSM"].fillna("-")
The combined key is matched against RSM&RCD. RCD is returned from RCD and RSM is returned from RSM_NEW. Any unmatched value is converted to -.
1.15 Output Overview
The generated workbook contains the filtered and mapped India funnel data. Temporary lookup fields are removed before saving. The output path is controlled by output_file.
| Output Column | Source / Logic |
|---|---|
| Segment | Source Data Segment after REL filtering |
| DAAS | Device as a Service → DAAS; otherwise - |
| Updated Opp Owner | Field Sales or Field Manager rationalized owner; - when both blank |
| New Region | Field Sales / Field Manager mapping; GAB/GTC override |
| Vertical | Field Sales / Field Manager mapping; GAB/GTC override |
| RCD | RegionVertical lookup → RCD |
| RSM | RegionVertical lookup → RSM_NEW |
1.16 Validation Checklist
- Input workbook opens successfully and contains the
Datasheet. - Segment column is detected using the row-1 / row-2 fallback.
- Only EA OL, GAB, GTC, Private Edu, Public, SA and SLBD are present.
- DAAS is
DAASonly for Solution Area = Device as a Service; otherwise-. - Field Sales mappings populate Updated Opp Owner, New Region and Vertical correctly.
- Field Manager is used only when Field Sales is blank and Field Manager is populated.
- Both blank ownership records have Updated Opp Owner / New Region / Vertical =
-. - GAB rows have New Region = GAB and Vertical = GAB.
- GTC rows have New Region = GTC and Vertical = GTC.
- RCD and RSM are populated from the RSM&RCD mapping or set to
-when unmatched. - Temporary RegionVertical is not present in the final output.
- Record count is reviewed against the expected filtered population.
- Output workbook is created successfully at the configured path.
1.17 Exception Handling
| Exception / Symptom | Action |
|---|---|
| Input file cannot be opened | Verify the exact input_file path, filename and workbook format. |
| Segment column not found in row 1 or row 2 | Check the Data sheet header position and exact spelling of Segment. |
| Region&Vertical sheet not found | Verify the sheet name exactly. |
| Required mapping column missing | Check the Region&Vertical workbook column names. |
| RSM&RCD sheet not found | Verify the sheet name and mapping workbook. |
| RCD / RSM remains - | Check RegionVertical construction and the corresponding key in RSM&RCD. |
| Output save failure | Close the output workbook and verify write permissions. |
Appendix A – Quick Run Checklist
- Confirm latest
IND PIPELINE.xlsx. - Confirm
Mapping-1787634732938.xlsxis available and containsRegion&VerticalandRSM&RCD. - Verify
input_file,output_fileandmapping_file. - Close the source and output Excel workbooks before execution.
- Open the Python script in VS Code.
- Confirm
pandasandopenpyxlare installed in the selected interpreter. - Run:
python your_script_name.py - Review the printed Rows remaining and Segment counts.
- Open the generated output workbook.
- Review DAAS, Updated Opp Owner, New Region, Vertical, RCD and RSM.
- Review any
-values that should have a mapping. - Confirm the temporary RegionVertical column is not present.
- Save/upload the validated output.
Appendix B – Detailed Code Explanation, Usage Guide and Error Handling
B.1 Objective of the Python Automation
The Python script automates repetitive Excel operations required to prepare the India funnel output. Instead of manually filtering segments and performing multiple ownership and RSM/RCD lookups, the script performs these operations in a controlled sequence. The automation is designed to be rerun for new input files by changing configuration paths rather than rewriting the transformation logic.
B.2 Before Running the Code – Required Setup
- Python installed and available from Command Prompt / VS Code terminal.
IND PIPELINE.xlsxor the approved current input workbook.Mapping-1787634732938.xlsx.- The Python script saved as a
.pyfile. - Write access to the output folder.
- Input and output Excel files closed during execution.
B.3 Install Required Python Libraries
python -m pip install pandas
python -m pip install openpyxl
Using python -m pip helps install packages into the Python interpreter associated with the Python command.
B.4 Import Section – What Each Library Does
| Library / Import | Purpose in India Funnel |
|---|---|
| pandas | Reads Excel files, filters records, creates lookup tables, maps columns and writes the output workbook. |
| openpyxl | Supports XLSX workbook operations used by pandas. |
B.5 File Path Configuration
input_file = r"C:\Users\W2625\Desktop\IND PIPELINE.xlsx"
output_file = r"C:\Users\W2625\Desktop\Funnel output\India Pipeline .xlsx"
mapping_file = r"C:\Users\W2625\Desktop\Mapping-1787634732938.xlsx"
The r before each Windows path creates a raw string so backslashes are treated as literal characters. Before each run, verify all three paths and confirm that the files exist.
B.6 Reading the Data Workbook
df = pd.read_excel(
input_file,
sheet_name="Data",
header=0
)
The script reads the Data sheet. It retries with header=1 if Segment is not detected in the first row. This is specifically intended to tolerate a one-row header shift.
B.7 Mapping Workbook Header Positions
| Workbook / Sheet | Current Header | Pandas Value | Purpose |
|---|---|---|---|
| IND PIPELINE.xlsx / Data | Excel row 1 normally | header=0 |
Primary source read; fallback header=1 if Segment is absent. |
| Mapping-1787634732938.xlsx / Region&Vertical | Excel row 2 | header=1 |
Field Sales / Field Manager mapping. |
| Mapping-1787634732938.xlsx / RSM&RCD | Excel row 1 | header=0 |
RCD and RSM lookup. |
If a reference sheet's header row moves, the code must be reviewed before execution. Do not change header values blindly.
B.8 Field Sales Mapping Logic
Field Sales Email is cleaned using strip() and lower(). The lookup returns Rationalised Field sales, Field Sales Region and Field Sales Vertical. The results populate Updated Opp Owner, New Region and Vertical respectively.
B.9 Field Manager Mapping Logic
Field Manager mapping is a fallback path. It applies only when Field Sales is blank and Field Manager is not blank. Field Manager Email is matched to Rationalised Field Manager, Field Manager Region and Field Manager Vertical.
B.10 GAB / GTC Special Rule
After the normal ownership mapping, GAB and GTC are explicitly overridden so that New Region and Vertical equal the segment itself. This rule must remain after the Field Sales / Field Manager mapping blocks.
B.11 RSM & RCD Mapping Logic
rsm_rcd_df = pd.read_excel(
mapping_file,
sheet_name="RSM&RCD",
header=0
)
rsm_rcd_lookup = (
rsm_rcd_df[
["RegionVertical", "RCD", "RSM_NEW"]
]
.drop_duplicates(subset="RegionVertical")
.set_index("RegionVertical")
)
The mapping sheet's RegionVertical is used as the lookup key. The pipeline creates the same key by concatenating New Region and Vertical. RCD is returned from RCD and RSM is returned from RSM_NEW.
B.12 Final Cleanup
df["RCD"] = df["RCD"].fillna("-")
df["RSM"] = df["RSM"].fillna("-")
df.drop(columns=["RegionVertical"], inplace=True)
df.to_excel(output_file, index=False)
The temporary RegionVertical helper column is removed before the final workbook is written.
B.13 How to Run the Code – Step by Step
- Open the Python file in VS Code.
- Confirm the selected Python interpreter is the environment where pandas and openpyxl are installed.
- Check
input_file,output_fileandmapping_file. - Close the input and output Excel workbooks.
- Open the VS Code Terminal.
- Run:
python your_script_name.py - Wait for the completion message, row count and segment counts.
- Open the generated India Pipeline output workbook.
- Review the validation checklist.
- Review any unmatched or
-mapping results before downstream use.
B.14 Expected Successful Run
Rows remaining: <number>
Segment counts:
<segment counts>
File saved to: C:\Users\W2625\Desktop\Funnel output\India Pipeline .xlsx
The exact record count changes with the source file. The important controls are that the script completes without a traceback, the output workbook is created, and the record count is reasonable compared with the source population after REL filtering.
B.15 Common Errors and How to Fix Them
| Possible Error | Action |
|---|---|
ModuleNotFoundError: No module named 'pandas' |
Run: python -m pip install pandas. Confirm VS Code uses the same interpreter. |
ModuleNotFoundError: No module named 'openpyxl' |
Run: python -m pip install openpyxl. |
FileNotFoundError |
Check the exact file path, filename, drive and extension in input_file / mapping_file. |
PermissionError: [Errno 13] Permission denied |
Close the output Excel file and verify write permission to the output folder. |
ValueError: Worksheet named 'Data' not found |
Open the input workbook and verify the sheet is named exactly Data. |
ValueError: Worksheet named 'Region&Vertical' not found |
Verify the mapping workbook sheet name and spelling. |
ValueError: Worksheet named 'RSM&RCD' not found |
Verify the mapping workbook sheet name and spelling. |
KeyError: 'Segment' |
Check whether the Data sheet header is in row 1 or row 2 and confirm the column spelling. |
KeyError: 'Solution Area' |
Verify the source column exists and has the expected spelling. |
KeyError: 'Field Sales' / mapping columns |
Verify the Region&Vertical header names and that Excel row 2 is the current header. |
KeyError: 'Field Manager' / mapping columns |
Verify the Field Manager columns in both source and mapping workbooks. |
RCD / RSM remains - |
Check New Region + Vertical, the generated RegionVertical key, and the matching key in RSM&RCD. |
| Excel output has 0 records | Check allowed REL segments and whether the source Segment values match exactly after trimming. |
B.16 Specific Excel ZIP / Workbook Error
KeyError: "There is no item named 'xl/_rels/workbook.bin.rels' in the archive"
This error usually occurs when pandas/openpyxl is attempting to read a file whose internal XLSX package is not valid. Common causes are a corrupted workbook, a file saved in a different Excel format but given an .xlsx extension, or an incomplete workbook.
- Identify which
read_excelcall failed by printing the file path immediately before each workbook read. - Open the suspected workbook manually in Excel. If Excel reports that the file is damaged or asks to repair it, obtain a fresh copy.
- Confirm the file extension matches the real workbook format. Do not simply rename
.xlsto.xlsx. - Save the workbook again from Excel using Excel Workbook (*.xlsx) if it is intended to be an XLSX file.
- Retry the Python script after replacing the damaged workbook.
- Do not change the pandas transformation logic merely to bypass a corrupted input workbook.
B.17 Troubleshooting Sequence
- Read the last lines of the traceback; they normally identify the failed line and missing item.
- Identify the exact workbook being read at the failure point.
- Check the file path, filename and extension.
- Open the workbook manually and verify it is healthy.
- Check the worksheet name.
- Check the source/reference column names.
- Check the Python interpreter and installed packages.
- Only after these checks, review the business logic or mapping rules.
B.18 Safe Maintenance Rules
- Do not overwrite the approved mapping workbook without keeping an approved copy.
- Do not change the REL segment list without business confirmation.
- Do not change the GAB/GTC override rule without testing and approval.
- Do not manually overwrite automated output values without recording the reason.
- After any code change, test against a known input and compare with an approved output.
- Keep the output file separate from the input and reference files.
B.19 Operator Quick Reference
| Task | What to Do |
|---|---|
| New input workbook | Change input_file and confirm sheet Data. |
| New output location | Change output_file. |
| New mapping workbook | Change mapping_file and verify both sheets. |
| Region&Vertical header moved | Review header=1; do not assume the old position is still correct. |
| RCD / RSM not mapped | Check RegionVertical key and RSM&RCD mapping. |
| Workbook ZIP / archive error | Validate the physical XLSX file and re-save/replace if corrupted. |
| Output validation | Use Section 1.16 checklist. |
B.20 Important Control Point
The automation standardizes the repeatable data preparation process; it does not replace business validation. Any unexpected segment, missing mapping, suspicious ownership assignment, unmatched RCD/RSM value, or workbook-format error must be reviewed before the India funnel output is shared or used downstream.