Cost centers with structured codes
Cost centers with structured codes, names, budgets and an optional parent.
simple
volume small
AccountingOrganization
- Languages
eng- Formats
csv
Recipe
gbddl 1
language eng
table cost_centers rows 12 (
id int64 autoincrement primarykey
code text unique pattern(pattern: "CC-####")
name text words(maxWords: 3)
budget decimal(12, 2) decimal(min: 10000, max: 5000000)
parent text null(30%) enum(values: ["corporate", "operations", "sales", "rnd"])
active boolean boolean(trueRate: 90%)
)
output csv
This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.
About this recipe
Cost centers
A single-table recipe that generates cost centers: structured codes, names, budgets and an optional parent.
What it demonstrates
- Structured code —
codeis auniquepatternmask. - Budget —
budgetis a decimal amount. - Optional parent —
parentpicks from anenumand is null in 30% of rows.
Run it
Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it
into Chef, to generate the data. The repository's local runner (run by
task test) also generates it and verifies its output.
The recipe outputs one CSV table file, cost_centers.csv, holding twelve rows.
Adapt it
- Change the
enumvalues to your own hierarchy. - Raise
rowsfor a larger center list.
Guarantees
Every row has a unique id and code; parent is null in the declared share
of rows. Values are synthetic.
Tested features
Smart types, physical types, rules and formats this recipe exercises and verifies.
patternwordsdecimalenumbooleannulluniqueautoincrementprimary-key