Dimensions and Metrics
The following shows part of a sample YAML file that defines a data model with dimensions and metrics, based on the orders
table in the connected database. Spreadic compiles this file and retrieves data from the model accordingly.
version: 2
models:
- name: orders
description: "Contains order information of each individual order"
meta:
label: 'Orders'
columns:
- name: order_id
description: "The unique identifier of the order"
meta:
dimension:
label: "Order ID"
metrics:
number_of_orders:
type: count
description: "Number of orders"
label: "Number of Orders"
- name: customer_id
description: "The unique identifier of the customer who made the order"
meta:
dimension:
label: "Customer ID"
metrics:
number_of_customers:
type: count_distinct
label: "Number of distinct customers"
description: "Number of Distinct Customers"
Last updated