mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-10 08:05:14 +02:00
28 lines
635 B
YAML
28 lines
635 B
YAML
|
|
name: partsupp
|
||
|
|
table: public.partsupp
|
||
|
|
grain: [ps_partkey, ps_suppkey]
|
||
|
|
columns:
|
||
|
|
- name: ps_partkey
|
||
|
|
type: number
|
||
|
|
- name: ps_suppkey
|
||
|
|
type: number
|
||
|
|
- name: ps_availqty
|
||
|
|
type: number
|
||
|
|
- name: ps_supplycost
|
||
|
|
type: number
|
||
|
|
- name: ps_comment
|
||
|
|
type: string
|
||
|
|
joins:
|
||
|
|
- to: part
|
||
|
|
"on": ps_partkey = part.p_partkey
|
||
|
|
relationship: many_to_one
|
||
|
|
- to: supplier
|
||
|
|
"on": ps_suppkey = supplier.s_suppkey
|
||
|
|
relationship: many_to_one
|
||
|
|
measures:
|
||
|
|
- name: total_supply_cost
|
||
|
|
expr: sum(ps_supplycost * ps_availqty)
|
||
|
|
description: "Total value of parts in stock"
|
||
|
|
- name: avg_supply_cost
|
||
|
|
expr: avg(ps_supplycost)
|