Skip to main content

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
PORTAL HIERARCHY (portal schema)Tier 1Tier 2Tier 31:N1:NCPIDwg_parent_accountsparent_account_idwg_accountscietrade_account_idwg_account_locationscietrade_address_idnew_ct.accountsaccount_id = CPIDnew_ct.addressesaddress_idPortal schemaCieTrade source

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:

CustomerCieTrade RealityBusiness Need
UPS1,500+ separate CPIDsConsolidated reporting across all facilities
McKessonMultiple CPIDs per regionSingle customer view for account management
Standard customers1 CPIDStill 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