Standardised DataMart Model

Core Views and their Standard Structures

Each DataMart will be built on six primary views:

  1. Details (or Core) – Foundational attributes, primary keys, and entity identification.
  2. Dates – Key lifecycle dates in ISO format.
  3. Values – Measures and calculated fields in structured form.
  4. Codes – Dimensions, hierarchies, and identifiers.
  5. Status – Lifecycle state, progress indicators, and historical tracking.
  6. Roles – Entity-to-person relationships, e.g., project managers.

1. Details (or Core) View

Purpose:

  • This view acts as the foundation for the DataMart.
  • It contains primary entity identifiers and high-level descriptive information.
  • The Company and Object_ID couplet serves as the primary key.
  • It includes a structured JSON object (SEQ) to support further relationships and metadata.

Schema:

Column NameData TypeDescription
companyVARCHARPrimary entity identifier
object_idVARCHARUnique object identifier (project_id)
seq_jsonJSONStructured metadata reference for linking
nameVARCHARName of the project/entity
descriptionTEXTBrief descriptive text
categoryVARCHARCategorical classification (e.g., business unit, cost centre)

🔹 Example of SEQ_JSON structure:

{
  "project_id": "123-456",
  "company": "BMT",
}

2. Dates View

Purpose:

  • This view stores all key dates related to the entity in a meta/fact table format.
  • Dates are always stored in YYYY-MM-DD ISO format.
  • Provides single-instance lifecycle tracking—for full history, a separate history table is required.

Schema:

Column NameData TypeDescription
seq_jsonVARCHARForeign key to details.core
keyVARCHARDate attribute name (start_date, end_date)
meta_valueDATELifecycle date in ISO format

🔹 Example:

seq_jsonkeymeta_value
{ “project_id”: “123-456”,
“company”: “BMT”,}
start_date2025-01-12
{ “project_id”: “123-456”,
“company”: “BMT”,}
completion_date2025-06-30

3. Values View

Purpose:

  • Stores all numeric and financial measures.
  • Includes a JSON object to store base values, exchange rates, and units.
  • Allows for flexible value representation, including currency conversions.

Schema:

Column NameData TypeDescription
seq_jsonVARCHARForeign key to details.core
keyVARCHARMeasure name (total_cost, revenue)
meta_valueDECIMAL(18,2)Stored numerical value
meta_detailsJSONJSON object describing base/currency values

🔹 Example of meta_details JSON:

{
  "base_value": 1000000,
  "currency": "GBP",
  "exchange_rate": 1.2,
  "local_value": 1200000
}

🔹 Example:

seq_jsonkeymeta_valuemeta_details
{ “project_id”: “123-456”,
“company”: “BMT”,}
total_revenue1000000{"currency":"GBP","exchange_rate":1.2,"local_value":1200000}
{ “project_id”: “123-456”,
“company”: “BMT”,}
total_hours5000{"unit":"hours"}

4. Codes View

Purpose:

  • Stores dimension values such as cost centres, project hierarchies, and external relationships.
  • Provides structured code-description pairs or parent-child hierarchies.
  • Ensures consistency in linking datamarts, especially for shared identifiers.

Schema:

Column NameData TypeDescription
seq_jsonVARCHARForeign key to details.core
keyVARCHARDimension type (customer_id, category_code)
meta_valueVARCHARDimension ID or code
meta_descVARCHARDescription of the code
parent_codeVARCHAR (nullable)Parent in hierarchy (if applicable)

🔹 Example:

json_seqkeymeta_valuemeta_descparent_code
{ “project_id”: “123-456”,
“company”: “BMT”,}
customer_idCUST-789ACME CorpNULL
{ “project_id”: “123-456”,
“company”: “BMT”,}
pru_codePRU-101Engineering DivisionPRU-100
{ “project_id”: “123-456”,
“company”: “BMT”,}
project_hierarchyPH-01Phase 1PH-00
{ “project_id”: “123-456”,
“company”: “BMT”,}
cost_hierarchyCC-02Cost Centre 2CC-01

5. Status View

Purpose:

  • Tracks the current state of an entity and enables historical status tracking.
  • Similar to a code but treated separately due to state transitions.
  • Captures timestamped status changes.

Schema:

Column NameData TypeDescription
json_seqVARCHARForeign key to details.core
keyVARCHARStatus type (project_status, approval_state)
meta_valueVARCHARCurrent status (Active, Pending, Completed)
status_dateDATEDate when status changed

🔹 Example:

json_seqkeymeta_valuestatus_date
{ “project_id”: “123-456”,
“company”: “BMT”,}
project_statusIn Progress2025-02-01
{ “project_id”: “123-456”,
“company”: “BMT”,}
project_statusCompleted2025-06-30

6. Roles View

Purpose:

  • Captures personnel and entity relationships (e.g., Project Manager, Line Manager).
  • Includes email for direct reference.
  • Useful for ownership and accountability tracking.
  • This view is not intended for resource activity tracking but rather for associating entities with key personnel

Schema:

Column NameData TypeDescription
json_seqVARCHARForeign key to details.core
keyVARCHARRole type (project_manager, line_manager)
meta_valueVARCHAREmployee ID
meta_emailVARCHAREmail (if applicable)

🔹 Example:

json_seqkeymeta_valuemeta_email
{ “project_id”: “123-456”,
“company”: “BMT”,}
project_managerEMP-1001pm@example.com
{ “project_id”: “123-456”,
“company”: “BMT”,}
line_managerEMP-2002lm@example.com

Conclusion

This standardised common DataMart model:
✅ Ensures consistency across all DataMarts
✅ Provides a clear separation of entity details, measures, and dimensions
✅ Enables easy JSON-based extensions
✅ Supports historical tracking via status

2. Potential Additional View Types (For Consideration)

2.1 History View

  • Purpose: Captures historical changes in attributes over time.
  • Why? The Status table captures high-level changes, but if field-level tracking (e.g., changes in project budgets, scope, or assigned teams) is needed, a dedicated history table may be beneficial.

Schema Example:

Column NameData TypeDescription
companyVARCHARForeign key to details.core
project_idVARCHARForeign key to details.core
keyVARCHARAttribute being tracked (budget, priority)
old_valueVARCHARPrevious value
new_valueVARCHARUpdated value
change_dateDATEDate of change

2.2 Relationships View

  • Purpose: Defines associations between different entities, such as dependencies or parent-child relationships.
  • Why? While Codes captures some hierarchical data, a more structured approach to linking projects, employees, customers, or external entities may be needed.
Column NameData TypeDescription
companyVARCHARForeign key to details.core
project_idVARCHARForeign key to details.core
related_entityVARCHARThe linked entity (customer_id, parent_project_id)
relationship_typeVARCHARType of relationship (sub-project, linked_customer)

2.3 Attachments View

  • Purpose: Stores references to external documents, images, or URLs.
  • Why? If project records need to be linked to documentation (e.g., contracts, reports, compliance documents), a structured way to track these references is useful.
  • Schema Example:
Column NameData TypeDescription
companyVARCHARForeign key to details.core
project_idVARCHARForeign key to details.core
attachment_typeVARCHARType of document (contract, invoice)
file_pathVARCHARLink to the document location

2.4 Notes/Comments View

  • Purpose: Allows free-text notes, comments, or annotations.
  • Why? This is useful for tracking audit trails, collaboration comments, or additional explanations tied to a project, employee, or other entity.
  • Schema Example:
Column NameData TypeDescription
companyVARCHARForeign key to details.core
project_idVARCHARForeign key to details.core
commentTEXTFree-text note or annotation
added_byVARCHARUser who added the comment
added_dateDATEDate of comment

2.5 Forecast/Projections View

  • Purpose: Stores future estimates for budget, costs, or resource planning.
  • Why? If forecasting is a critical part of your analytics, a dedicated table can hold expected versus actual values.
  • Schema Example:
Column NameData TypeDescription
companyVARCHARForeign key to details.core
project_idVARCHARForeign key to details.core
forecast_typeVARCHARType (budget, revenue, resource_hours)
forecast_valueDECIMAL(18,2)Predicted value
forecast_dateDATEDate of forecast

Leave a Comment