Column Mappings¶
Column mappings enable CalcBridge to understand data from different sources with varying column headers. This guide covers what mappings are, how to create mapping profiles, apply mappings during upload, and manage your mapping configurations.
What Are Mappings?¶
Different data providers often use different column names for the same data:
| Data Field | Source A | Source B | Source C |
|---|---|---|---|
| Loan Amount | Principal | Current_Balance | Par Value |
| Interest Rate | Coupon | Rate | Spread |
| Rating | MoodyRating | Moody_Rating | Moodys |
| Maturity | MaturityDate | Maturity | Final_Maturity |
Mappings tell CalcBridge how to interpret these different column names so your formulas and compliance tests work consistently regardless of data source.
How Mappings Work¶
flowchart LR
subgraph Input["Source Data"]
A["Current_Balance"]
B["Rate"]
C["Moody_Rating"]
end
subgraph Mapping["Mapping Profile"]
D["Current_Balance -> Principal"]
E["Rate -> Coupon"]
F["Moody_Rating -> Rating"]
end
subgraph Output["Normalized Data"]
G["Principal"]
H["Coupon"]
I["Rating"]
end
A --> D --> G
B --> E --> H
C --> F --> I Mapping Profiles¶
A mapping profile is a reusable configuration that maps source columns to CalcBridge's standard column names.
Standard Column Names¶
CalcBridge uses a standard set of column names for CLO analytics:
| Category | Standard Columns |
|---|---|
| Identifier | cusip, isin, loan_id, obligor_name |
| Principal | principal, par_value, current_balance, original_balance |
| Rates | coupon, spread, floor, margin |
| Ratings | moodys_rating, sp_rating, fitch_rating |
| Dates | maturity_date, settlement_date, issue_date |
| Classification | industry, sector, country, currency |
| Metrics | price, market_value, wal, was |
Built-in Alias Profiles¶
CalcBridge includes built-in profiles for common data sources:
| Profile | Description |
|---|---|
default | Standard CalcBridge column names |
bloomberg | Bloomberg Terminal export format |
markit | IHS Markit data format |
loanx | LoanX/LSTA format |
intex | Intex Solutions format |
custom | User-defined mappings |
Creating Mapping Profiles¶
Via UI¶
- Navigate to Mappings in the main menu
- Click Create Profile
- Enter a profile name and description
- Add column mappings:
- Source Column - The column name in your data
- Target Column - The CalcBridge standard name
- Click Save Profile
Via API¶
curl -X POST https://api.calcbridge.io/api/v1/mappings \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Provider X Format",
"description": "Mapping for Provider X monthly data files",
"mappings": {
"Current_Balance": "principal",
"Coupon_Rate": "coupon",
"Moody_Rtg": "moodys_rating",
"SP_Rtg": "sp_rating",
"Final_Mat": "maturity_date",
"GICS_Sector": "industry"
},
"transformations": {
"coupon": {
"type": "percentage",
"multiply_by": 100
},
"maturity_date": {
"type": "date",
"format": "YYYY-MM-DD"
}
}
}'
Mapping Options¶
| Option | Description |
|---|---|
| Case Insensitive | Ignore case when matching columns |
| Fuzzy Matching | Match similar column names automatically |
| Required Columns | Fail import if these columns are missing |
| Default Values | Use default if column is missing |
Column Transformations¶
In addition to renaming columns, mappings can transform data:
Data Type Transformations¶
| Transformation | Description | Example |
|---|---|---|
| Number | Convert to numeric | "100" -> 100 |
| Percentage | Convert to decimal | 5.5 -> 0.055 |
| Date | Parse date string | "2025-01-15" -> Date object |
| Boolean | Convert to true/false | "Y" -> true |
| Text | Ensure text type | 12345 -> "12345" |
Value Mappings¶
Map specific values to standardized values:
{
"transformations": {
"moodys_rating": {
"type": "value_map",
"mappings": {
"Aaa": "Aaa",
"AAA": "Aaa",
"Aa1": "Aa1",
"AA+": "Aa1"
}
}
}
}
Computed Columns¶
Create new columns from existing data:
{
"computed_columns": {
"market_value": {
"formula": "principal * price / 100",
"dependencies": ["principal", "price"]
},
"months_to_maturity": {
"formula": "DATEDIF(TODAY(), maturity_date, \"M\")",
"dependencies": ["maturity_date"]
}
}
}
Applying Mappings on Upload¶
During Upload¶
When uploading a workbook, you can specify a mapping profile:
- Click Upload Workbook
- Select your file
- In the Mapping Profile dropdown, select your profile
- Preview the mapped columns
- Confirm and upload
Auto-Detection¶
CalcBridge can automatically detect and suggest mapping profiles:
- Upload a file without specifying a profile
- CalcBridge analyzes column headers
- Suggests matching profiles ranked by confidence
- Select the best match or create a new profile
Preview Before Apply¶
Always preview mappings before applying:
{
"source_columns": ["Current_Balance", "Coupon_Rate", "Moody_Rtg"],
"mapped_columns": ["principal", "coupon", "moodys_rating"],
"unmapped_columns": ["Internal_ID", "Notes"],
"missing_required": []
}
Managing Mappings¶
Viewing Profiles¶
Navigate to Mappings to see all profiles:
| Column | Description |
|---|---|
| Name | Profile name |
| Description | Profile description |
| Columns Mapped | Number of column mappings |
| Last Used | When profile was last used |
| Created | Creation date |
Editing Profiles¶
- Click on a profile to open it
- Modify mappings as needed
- Click Save Changes
Editing Active Profiles
Editing a profile affects all future uploads using that profile. Existing workbooks are not retroactively changed.
Duplicating Profiles¶
Create a new profile based on an existing one:
- Click the ... menu on a profile
- Select Duplicate
- Enter a new name
- Modify as needed
- Save the new profile
Deleting Profiles¶
- Click the ... menu on a profile
- Select Delete
- Confirm deletion
Built-in Profiles
Built-in alias profiles cannot be deleted, but you can create custom profiles that override them.
Mapping Diagnostics¶
CalcBridge provides diagnostics to help troubleshoot mapping issues.
Schema Drift Detection¶
CalcBridge detects when source data schema changes:
{
"schema_drift": {
"new_columns": ["Additional_Field"],
"missing_columns": ["Old_Field"],
"type_changes": [
{
"column": "coupon",
"expected": "number",
"actual": "string"
}
]
}
}
Mapping Audit¶
View mapping audit information:
{
"audit": {
"total_columns": 25,
"mapped_columns": 22,
"unmapped_columns": 3,
"transformation_applied": 8,
"warnings": [
"Column 'Notes' was not mapped"
]
}
}
Validation Errors¶
Common mapping validation errors:
| Error | Cause | Solution |
|---|---|---|
Required column missing | Expected column not in source | Add column or update mapping |
Type conversion failed | Cannot convert value | Check transformation rules |
Duplicate mapping | Same source mapped twice | Remove duplicate mapping |
Invalid target column | Target not in standard list | Use valid standard column name |
Best Practices¶
Naming Conventions¶
Use clear, descriptive profile names:
[Provider] - [Data Type] - [Version]
Examples:
- Bloomberg - Holdings - v2
- Internal - Monthly Report
- Trustee X - Quarterly Data
Documentation¶
Document your mappings:
- Add descriptions to profiles
- Note any special transformations
- Record source data provider
- Document any quirks or edge cases
Testing¶
Test mappings before production use:
- Upload a sample file with the mapping
- Verify all columns mapped correctly
- Check transformation results
- Validate calculated columns
Version Control¶
Maintain mapping versions:
- Create new profiles for major changes
- Keep old profiles for historical data
- Document changes between versions
Mapping Hub¶
The Mapping Hub (/mappings) provides a central interface for managing all mappings.
Features¶
| Feature | Description |
|---|---|
| Profile List | View all mapping profiles |
| Column Browser | Browse standard columns |
| Mapping Editor | Visual mapping configuration |
| Preview | Test mappings with sample data |
| Import/Export | Share profiles between tenants |
Workflow¶
flowchart LR
A[Upload Sample] --> B[Auto-Detect]
B --> C[Review Suggestions]
C --> D[Edit Mappings]
D --> E[Preview Results]
E --> F[Save Profile]
F --> G[Use in Upload] API Reference¶
List Mapping Profiles¶
Get Profile Details¶
curl -X GET https://api.calcbridge.io/api/v1/mappings/{profile_id} \
-H "Authorization: Bearer $TOKEN"
Update Profile¶
curl -X PUT https://api.calcbridge.io/api/v1/mappings/{profile_id} \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Profile Name",
"mappings": { ... }
}'
Delete Profile¶
curl -X DELETE https://api.calcbridge.io/api/v1/mappings/{profile_id} \
-H "Authorization: Bearer $TOKEN"
Test Mapping¶
curl -X POST https://api.calcbridge.io/api/v1/mappings/{profile_id}/test \
-H "Authorization: Bearer $TOKEN" \
-F "file=@sample.xlsx"