π Purpose
This page provides an overview of the product-related data views based on OCNS and CEFAS environmental regulatory sources. These views support reporting, environmental compliance, and substitution warning analysis across various product categories.
π Use Cases
- Identify expired or soon-to-expire products by
Expiry_Date
- Filter products with high-risk
HQ_Band
- Highlight substitution-recommended products
- Segment product availability by region or use-case
ποΈ DataViews Summary
The following views are published within the cefas
schema:
DataView Name | Category Description | Notes / Source |
---|---|---|
Cementing_Products | Cementing Products | From CEFAS import |
CompletionWorkover_Products | CompletionWorkover Products | From OCNS product registry |
WBM_Drilling_Products | WBM Drilling Products | Water-based mud group |
Production_Products | Production Products | General production use |
Non_CHARMable_products | Non-CHARMable Products | Out-of-scope for CHARM |
π Standard Schema
Each product view includes the following structure:
Field | Description |
---|---|
Product_Name | Name of the registered product |
Company | Company responsible for the product |
HQ_Band | Hazard Quotient (HQ) band classification |
Product_Warning | General warning associated with the product |
Substitution_Warning | Indicates whether a substitution is recommended or required |
Function | Primary function of the product (e.g., cementing, drilling fluid) |
Expiry_Date | Expiry date for product registration |
Version_No | Version number of the product information |
Registration_No | OCNS/CEFAS registration number |
Registered_for_Use_in | Countries or regions where product use is approved |
NL_HMCS_Category | Netherlands HMCS classification, where applicable |
pipeline_log | Technical log information from ingestion pipeline |
file_date | Date the product file was ingested into the system |
π‘ Multi-Category Product Query β Summary of Work
We developed a robust and reusable query framework to extract and categorise products from OCNS and CEFAS source files across multiple product categories in a single operation.
This approach:
- Reduces duplication
- Improves performance
- Lays a foundation for maintainable and scalable data views
π οΈ Highlights
- Single source ingestion: One raw file powers all views
- Dynamic category allocation: Category assignment via rules or mappings
- Consistent schema and logic: Standard fields across all views
- Separation of logic and presentation: Category views are filtered subsets
π§Ύ Power Query Implementation
π§± Create: Product View Summary Table
This table should contain view_name
and category
for each DataView:
powerqueryCopyEditProductViews = Table.FromRecords({
[view_name = "Cementing_Products", category = "Cementing Products"],
[view_name = "CompletionWorkover_Products", category = "CompletionWorkover Products"],
[view_name = "WBM_Drilling_Products", category = "WBM Drilling Products"],
[view_name = "Production_Products", category = "Production Products"],
[view_name = “Non_CHARMable_products”, category = “Non-CHARMable Products”]
})
π§ Create: LoadProductCategory
Function
powerqueryCopyEdit(viewName as text, category as text) =>
let
Source = Sql.Database(DataMart_Host, DataMart_Endpoint,
[Query = "EXEC get.myView @viewName = '" & viewName & "', @token = '" & DataMart_Token & "', @version = 'beta'"]),
AddCategory = Table.AddColumn(Source, "product_category", each category)
in
AddCategory
π This defines a reusable function to load a product view and append its category.
π Apply Function Across Views
powerqueryCopyEditlet
SourceTable = ProductViews,
AddData = Table.AddColumn(SourceTable, "Data", each LoadProductCategory([view_name], [category])),
Expanded = Table.Combine(AddData[Data])
in
Expanded
β This loads and combines all product views, each tagged with their category β ideal for unified analysis, dashboards, and regulatory summaries.