Order: Meta_Codes

What this view is for

Order.meta_codes provides the categorisation, classification and relationship context for customer orders.

If Order.core_details defines what the order is, meta_codes explains how the order should be interpreted, grouped and related within reporting.

This includes order state, customer context, sales ownership and cross-domain link keys.


Level of detail (grain)

  • Multiple rows per order
  • One row per code attribute

This view is intentionally long and thin.
An order with several coded attributes will appear multiple times — once per attribute.

This design allows attributes to evolve without breaking reports.


What you’ll find in this view

Each row represents a single coded attribute for an order and typically includes:

  • OBJECT_SEQ – the paired company + order identifier
  • META_TYPE – the category of the code
  • ATTRIBUTE – the specific attribute name
  • A value payload (often code + description)

The meaning of a value always comes from the META_TYPE + ATTRIBUTE combination.


How to join this view

Every row includes the same OBJECT_SEQ used in Order.core_details.

Always join Order.meta_codes to Order.core_details using OBJECT_SEQ.

This keeps joins safe, consistent, and aligned with the wider Sales Pipeline model.


Working with the long, thin structure

Order.meta_codes is designed for flexibility, not immediate report consumption.

In most reports, you’ll want to shape it deliberately:

  1. Filter to the code types you need
  2. Create a combined attribute identifier
  3. Pivot to a wide, report-friendly shape

Creating a combined code attribute

Because META_TYPE provides essential context, it’s strongly recommended to create a combined attribute field.

Example (Power Query):

= Table.AddColumn(
    Source,
    "CODE_ATTRIBUTE",
    each [META_TYPE] & "_" & [ATTRIBUTE],
    type text
)

This avoids ambiguity and makes pivoting predictable.


Pivoting to a wide attributes table

Once combined, pivoting allows you to:

  • Turn each CODE_ATTRIBUTE into a column
  • Reduce each order to a single row
  • Work with explicit, recognisable fields in visuals

This is often the most practical shape for reporting.


Codes Helper for slicers

For slicers, it’s often better to build a Codes Helper table rather than slicing directly from the long-thin data.

A Codes Helper:

  • Provides a distinct list of codes and descriptions
  • Avoids pulling order grain into slicers
  • Keeps filtering behaviour clean and predictable

The same helper pattern used for Busopp applies here and supports cross-domain consistency.


Codes currently available in Order meta_codes

The following META_TYPE / ATTRIBUTE combinations are available:

META_TYPEATTRIBUTE
STATESTATE
STATECANCEL_REASON
CUSTOMERCURRENCY
CUSTOMERAUTHORIZE_CODE
CUSTOMERCONTRACT
CUSTOMERPO_NO
LINK_KEYCUSTOMER_ID
LINK_KEYPROJECT_ID
LINK_KEYOPPORTUNITY_NO
SALESREGION
SALESDISTRICT
SALESMAIN_REPRESENTATIVE
SALESMARKET

How these are typically used

These attributes support questions such as:

  • What is the current state of the order?
  • Why was an order cancelled?
  • Which contract, PO and currency apply?
  • Which customer, project or opportunity does the order relate to?
  • Which sales region, market or representative owns the order?

They are commonly paired with:

  • Order.meta_dates for timing
  • Order.item_values_lines for value
  • A Codes Helper table for slicers

Things to watch out for

  • Don’t assume one row equals one order — always consider grain
  • Always anchor joins through Order.core_details using OBJECT_SEQ
  • Be deliberate about which attributes you pivot or expose

If order counts change unexpectedly after adding codes, revisit joins and shaping first.


Where this fits in a report build

A typical flow is:

  1. Start with Order.core_details
  2. Join Order.meta_codes for categorisation
  3. Shape or pivot attributes as required
  4. Add meta_dates and item_values_lines for timing and value

This keeps identity, context and metrics clearly separated.


Key takeaway

Order.meta_codes is your flexible catalogue of order attributes.

Shape it deliberately, use OBJECT_SEQ consistently, and rely on META_TYPE + ATTRIBUTE to preserve meaning.
Done well, it gives order reporting depth without complexity.

Leave a Comment