CieTrade Account Hierarchy
The account structure follows a three-tier hierarchy designed to support consolidated reporting for customers who span multiple CieTrade counterparties.
Architecture
View:
Complete account hierarchy with CieTrade integration
Why This Hierarchy Exists
The Business Problem
CieTrade has no native parent account concept. Each customer facility is treated as an independent counterparty (CPID). This creates challenges for enterprise customers:
| Customer | CieTrade Reality | Business Need |
|---|---|---|
| UPS | 1,500+ separate CPIDs | Consolidated reporting across all facilities |
| McKesson | Multiple CPIDs per region | Single customer view for account management |
| Standard customers | 1 CPID | Still need hierarchy for consistent data model |
The Solution
📊
Consolidated Reporting
Roll up metrics across multiple CPIDs to a single parent
🔗
Consistent Data Model
Same structure for all customers regardless of CieTrade complexity
🔑
Stable Identifiers
location_id provides consistent FK for reporting tables
Unified View
portal.vw_wg_accounts joins all three tables into a flat, queryable interface for reporting.
Primary Interface
When building reports, always start with portal.vw_wg_accounts as your primary integration point.
Next Steps
- Data Model - Explore the three-tier table structure
- Relationship Patterns - Understand 1:1:N vs 1:N:N patterns
- Exploration Queries - SQL queries for investigating hierarchies