Star schema
Build each dimension and fact
Once a plan exists, every dimension and fact is built the same way: confirm where its data comes from, create its table, then generate its load procedure. You can walk one item through the steps yourself, or let Kenseme build every remaining item in the background.
In the app: Data Model › Schemas › your source schema › Star Schema tab › a plan
Read the plan dashboard¶
The header shows source → plan → destination and how many items are complete, for example 3/8 complete.
Under Plan Items, items are split into Dimensions and Facts, in build order: DimDate first, then the other dimensions A–Z, then facts by execution group. Each card shows:
- A status icon: an empty circle (not started), a clock (in progress), or a green check (complete).
- The name and type badge, for example
SCD2orTransaction. - A
Group nbadge on facts that build after other facts. - Progress so far, for example
View ✓ Table ✓. - The source, for example
View needed,Direct source, or the fact’s grain. - For facts,
Waiting on:followed by the dimensions that must be built first. - Once complete,
View created,Table created, andProcedure createdbadges.
Click Start Building → (or Continue Building →) on a card to open that item at the step it has reached.
The three steps¶
A step indicator shows A Source, B Table, and C Procedure, with a check on each step that is done. Click a completed step to go back to it. Back to Plan returns to the dashboard at any point. Your progress is saved after each step.
Step A: Source¶
Every item needs one source: an existing table or view in the source schema, or a new view that combines several tables.
When one table is enough, you see Verify the source table or view has the columns you need:
- Check the table picked in
Source, or pick another fromTables and views from source schema. - Review
Source Columns:Column,Type,Nullable, andPK. - Under
Looks right?, chooseYes, this table has everything I need, orNo, I need a different source. - Click
Confirm & Next >.
If the plan named a source table that doesn’t exist in the schema, a message says so and asks you to pick the correct one.
When the item combines several tables, Kenseme drafts a source view for you:
- The step opens with
Drafting source view…while AI writes the view SQL from the item’s design instruction. - Read
Agent notes, if any, and expandDesign Instructionto see what the AI was asked to build. - Check
View Name. The view is created in the source schema. - Review and edit
View SQL. Nothing is created until you click the button in step 6. - If the draft isn’t right:
- Type
Extra guidance for the AI (optional)and clickRegenerate with AI. - Or click
Write SQL myselfand write theCREATE VIEWstatement yourself. - Or click
Pick a single existing table instead.
- Type
- Click
Create View & Next >.
If the draft fails, The view draft failed explains why. You can regenerate or write the SQL yourself.
Step B: Table¶
Step B shows the item’s Source, Destination, and Load Strategy, then the Destination Columns the table will have. The Origin column tells you where each comes from:
SurrogateKey: the surrogate key, for exampleDimCustomerKey, added when the plan adds surrogate keys.Source: a column carried over from the source.Audit: a housekeeping column the load strategy needs, such as load timestamps or history tracking columns.
Click Create Table & Next >. The table is created in the plan’s destination schema.
Step C: Procedure¶
Step C generates the procedure that loads the table (a Python load function for Databricks).
- For a fact, review
Dimension Lookups. It shows how the procedure turns each source key into a dimension’s surrogate key:Single-Key Lookups:FK Column,Source NK,Dimension(with arole:badge for role-playing dimensions),Dim NK, andSCD2 Aware.Composite-Key Lookups: eachSource Columnpaired with itsDim Column.
- If a fact’s dimensions aren’t built yet, you see
Build these dimensions before generating this fact's procedure:with the list. Build those first. - Click
Generate Procedure. The result appears underGenerated (n lines). - Click
Doneto return to the dashboard. The item is now complete.
If the source changed since the item was designed, a banner says The source schema changed since this item was designed — its prompts may be stale. Click Refresh Prompts before generating. See Keep a plan in step with its source.
Build the date dimension¶
DimDate has no source table and no A/B/C steps. It is generated from settings:
- Click
Start Building →onDimDate. - Set
Range StartandRange End. - Check
Preset. Keys use the formatint yyyymmdd, for example20260703. - Optionally tick
Include fiscal calendarand setFiscal year starts in month(1–12). - Click
Generate Script. The create-and-populate script appears underGenerated: <name>. - Click
Done.
Generating again replaces the earlier script.
Build the whole plan at once¶
Instead of stepping through each item, you can build everything that isn’t complete yet in the background.
- On the dashboard, click
Build Pipeline. - Review the
Build Pipelinedialog:- Errors under
Fix these before building the pipeline:block the build. - Warnings are for your information.
- The groups to build, in order. Items already complete are shown in green and skipped.
- A count, for example
Will build 5 item(s) across 2 group(s); 3 already complete will be skipped.
- Errors under
- Leave
Generate the master procedure after a successful buildticked to finish with the master procedure. - Click
Start build.
A progress card shows which group is building and how many items have finished. Each item card shows Queued, its current step, Built, Skipped, or Failed. Hover over Failed to see the reason and click Retry to open that item’s steps. Click Stop to stop the build. You can leave the page; the plan list shows a Building… badge until the build finishes.
To build a single group, click Build group next to it in Recommended Build Order.
Build runs use AI for source views and count toward your AI usage.
Note: Bridge items are always built by hand. The bulk build skips them and says so.
Add an item by hand¶
- Click
+ Add Item Manually. - Fill in
Item Name(for exampleDimCustomer) andCategory:Dimension,Fact, orJunkDimension. - For a dimension, pick the
Dimension Type(SCD1orSCD2). For a fact, pick theFact Type(Transaction,AccumulatingSnapshot,PeriodicSnapshot, orFactless). - Pick the
Source Table. It is optional for a junk dimension. - Pick the
Business Key Columnsand, for an SCD2 dimension, theSCD2 Tracked Columns. - Optionally describe the
Grain (optional), for exampleOne row per order line. - For a fact, add
Dimension Lookups: for each, the source FK column, the dimension, and the surrogate key column. ClickAdd lookupfor more. - Click
Add Item.
A toast confirms the item was added. Any warnings appear in an Item added with warnings dialog.
Edit a dimension lookup¶
- On the dashboard, expand
Bus Matrix. - Click the
Xin a cell. Role-playing lookups show their role, for exampleX (ShipDate). - Change the
Fact FK Column, theDimension Surrogate Key Column, or theUnknown Member Key(used when no dimension row matches; default-1). - Click
Save Changes.
Header colours in the plan’s bus matrix show build status: green for complete, orange for in progress, and grey for not started.