π Description
This view provides a structured metadata representation of Business Opportunities (BusOpp), transforming source data into a JSON-like attribute-value format. It supports consistent reporting and simplifies analytics by organising attributes under clear META_TYPE
categories like OPPORTUNITY, STATUS, and SALES.
π― Purpose
- To standardise metadata across all Business Opportunity reporting use cases.
- To offer a code-value-description model that is both user-readable and machine-readable.
- To align attribute sourcing across multiple IFS tables under a unified format.
- To serve as the primary metadata layer for
busopp.core
,busopp.details
, andbusopp.values
.
β Use Cases
- To enrich
busopp.details
with decoupled code metadata. - To enable drill-through or filter panels in Power BI with properly labelled values.
- To ensure audit trails and clear lineage of classification fields.
- To support flexible value reporting, including grouping, filtering, or classification.
π§± Structure
Each row in the view corresponds to a single metadata entry, uniquely identified by:
OBJECT_SEQ
β combination ofCOMPANY
andOPPORTUNITY_NO
META_TYPE
β high-level classification (e.g. OPPORTUNITY, STATUS, SALES)ATTRIBUTE
β the specific metadata label (e.g. RISK_LEVEL, STAGE, MARKET)CODE_VALUE
β the raw or hashed codeVALUE_METADATA
β JSON block containingCODE
,DESC
, and any additional context
π Sourcing Logic
The view is built using a sequence of CTEs and CROSS APPLY
transformations:
OBJECT_SOURCE
: Generates the unique identifier (OBJECT_SEQ
) for each opportunity.META_OPPORTUNITY
: Extracts attributes like Strategic Pillar, PRU Code, Programme ID, and Risk Level from opportunity tables.META_STATUS
: Captures status-related metadata like Stage, State, Win/Loss Reason with embeddedNOTE
blocks.META_SALES
: Extracts sales hierarchy data including Region, Market, District, Target Customer, Contact, and Representative.
Each value is tagged with:
- A source system identifier (e.g.,
FACT_BUSINESS_OPP_OL$
) - A JSON-formatted description
- A checksum for auditing changes
π§Ύ Output Columns
Column | Description |
---|---|
OBJECT_SEQ | Unique identifier { "COMPANY": "X", "OPPORTUNITY_NO": "Y" } |
META_TYPE | One of: OPPORTUNITY , STATUS , SALES |
ATTRIBUTE | Attribute name (e.g. PRU_CODE , STATE , REGION ) |
CODE_VALUE | Raw or hashed code used for classification |
VALUE_METADATA | JSON describing the code, label, and (where relevant) note |
SOURCE_SYSTEM | The table where the data came from |
CREATE_DATE | Date the row was created (default: current date) |
EXPIRY_DATE | Expiry of the record (default: 2099-12-31) |
ACTIVE_FLAG | Boolean flag (1 = active) |
CHECKSUM | MD5 hash of core fields to detect changes |
π Key Notes
- Working at Risk (WAR): Is embedded in the
STAGE
attribute if applicable. - Lost Reasons: May include optional JSON
NOTE
entries withREASON
,CANCELLATION
,LOST_TO
. - TARGET_CUSTOMER: Extracted from compound fields (e.g., β12345 β Acme Ltdβ).