Use cases · Retail
Stores, web and stock.One view.
Sales and inventory live in different systems. By the time they're joined by hand, the answer is old.
Retail data never sits still.
Every retail question is the same question asked a different way: what sold, where, through which channel, at what margin, and what is left on the shelf. Answering it means joining systems that were never built to agree, every night, before the stores open.
Underneath sit a staging layer, a history layer and reporting tables, plus a load for each source table in each of them. Built by hand, each new channel adds another stack of pipelines, and the warehouse falls further behind the business. BimlFlex generates all of it from one model of your sources, as native code on your own platform, so a new channel is a re-import and a rebuild.
Many channels, one catalog
Store tills, the web shop, the merchandising system, warehouse stock and loyalty each keep their own keys. Product 1001 in one can be a different item in another.
Files, not just databases
Stores and suppliers drop daily files into a folder. Each one has to be picked up, loaded and set aside if it fails.
Volume that only grows
Sales land at order-line grain. Full reloads stop being possible, so every load has to take only what changed.
Late tills, late corrections
A store goes offline and posts hours later. Returns and price fixes arrive after the day closes.
History that matches the sale
Stores change region, products change category. A comparable-store report needs the store as it was on the day of the sale.
ON s.[ProductID] = w.[ProductID]Forty store files. One package.
Most retail estates start with files: a stock count from every store, every night, in the same layout. The classic SSIS answer is a package per file, copied and edited. With Biml you describe the file layout once and loop the folder: a For Each File loop sets the current file on the connection, a derived column stamps the file name on every row, and one target table collects them all.
It is plain Biml, so it runs in BimlExpress, the free add-in for Visual Studio 2012 to 2019, and in BimlStudio, where the File Format editor holds each layout and the whole project builds from the command line. Wrap the package in a small template and you get one package per file shape, all built the same way. In BimlFlex, files are just another connection: delimited or ragged right, plus Parquet, JSON and Avro on Data Factory. On Azure storage, processed files move to an archive container and files from a failed load move to an error container, both on by default.
- One layout, defined once
- The file name on every row
- Archive and error containers in BimlFlex
Same number. Two products.
The tills call a garden hose product 1001. The web shop gave 1001 to a coffee grinder years ago. Join the two on the raw ID and the warehouse quietly sells hoses online. In Data Vault terms the fix is an integration key that carries its source.
BimlFlex builds every integration key with FlexToBk(@@rs, ProductID): the record source, a tilde, then the value, hashed into the hub's key. Add Record Source To Integration Key is on by default, so pos~1001 and web~1001 land as two members of one product hub, each with its own satellite. When your product numbers really are shared across channels, a global SKU from the merchandising system, turn it off and the same number resolves to the same key by design.
- Every key carries its channel
- One hub, a satellite per channel
- Off when your SKU is truly global
FlexToBk(@@rs, ProductID)FlexToBk(ProductID)Only what's new. Late tills included.
Reloading every order line every night stops working long before peak season. The standard answer is a high-water mark: remember the last modified time you loaded and read only the rows after it. A load window adds an upper bound, so every run reads a closed range and the next run starts exactly where this one ended.
In BimlFlex that is a Load Parameter on the column: LastLoadDate with operator >, NextLoadDate with operator <=, and a default of 1900-01-01 for the very first run. Values are kept in BimlCatalog on your own SQL Server, with the previous value and a history row for every run. For a store that posts late, Parameter Override reaches back: DATEADD(dd, -3, ?) re-reads the last three days. Order databases with Change Data Capture can feed the same staging layer instead.
- A closed window every night
- Values and history in BimlCatalog
- A three-day reach-back for late stores
Store 0418, 6 order lines sold Sun 21:40, posted Tue · outside the windowStore 0418, 6 order lines sold Sun 21:40, posted Tue · read by the reach-back
The store as it was on the day of the sale.
Store 0412 moved from the North region to East on March 1. A February sale should still count for North, or every comparable-store and region report shifts under your feet. That is a Type 2 attribute: a new dimension row with start and end dates, while a spelling fix to the store name simply overwrites in place as Type 1.
In BimlFlex you set it per column: Update for Type 1, Track History for Type 2. Default Change Type decides which one new dimensions start with. The generated load inserts the new version, end-dates the old one with a LEAD over the start dates and clears its current flag. The fact load then finds the store row whose dates contain the order date, so February's sale keeps North and March's goes to East.
- Type 1 or Type 2, column by column
- Old rows end-dated, never lost
- Facts join on the order date
Early sales. Vanished items. Late fixes.
Three things happen every week in retail, and each one breaks a naive load. A till sells a new item before the product master has it. An item drops out of the catalog because the source simply deleted the row. A price correction for last Friday arrives on Tuesday.
For the early sale, the fact load puts the row on the unknown member, -1, so nothing drops out; on SSIS without pushdown, Infer Dimension Members creates a placeholder member instead. For the vanished item, Enable Delete Detection compares a full key extract with what is already loaded and writes a delete row. It is off until you choose it; Apply Delete Detection DV and PSA are on by default, so one switch carries the delete into the vault and persistent staging. For the late fix, Delta Is Late Arriving puts the row back into its place in the persistent staging timeline, and PIT Lag Days rebuilds point-in-time snapshots over a trailing window.
- -1, or a placeholder member on SSIS
- Deletes found by full key compare
- Late rows slotted into history
No dim.Product row yet, so the line lands on the unknown member. It is never dropped.
The key is missing from the extract, so the satellite gets a delete row.
Friday's price fix arrives on Tuesday and takes its place in the timeline.
Numbers you can open the stores on.
The morning flash report is only as good as last night's batch. When a store total looks wrong at 7 a.m., someone has to know which run loaded it, how many rows came across and where the window stopped.
Every generated pipeline logs to BimlCatalog on your own SQL Server: the run starts, the parameters are read, each copy logs its row count, the staging and vault procedures run, the new high-water mark is saved and the run ends. A failed step runs its own error activity. Every row the load writes carries the run's audit id, so a number in the report leads back to the run that produced it.
- Every run logged
- Row counts per copy
- The audit id on every row
Not every column belongs in the warehouse.
Card data and customer personal data come with their own rules, and the safest copy of a column is the one you never load. Most analytics needs the line, the store, the item and the amount, not the card behind it.
In BimlFlex that choice sits on the column. Mark it Ignore and it never appears in the object or in any pipeline. Mark it Exclude DV and it is staged, and kept in persistent staging if you use it, but never carried into the Data Vault. The choice lives in the model, so it holds on every rebuild and on all four platforms. Your rules decide which columns those are.
- Ignore: never loaded
- Exclude DV: staging only
- Kept in the model, on every rebuild
Pick the tool for the estate you have.
All three run on Biml. BimlFlex generates the whole warehouse from one model, files, databases and change data capture through staging, Data Vault and data marts, on SQL Server, Synapse, Snowflake or Databricks with SSIS or Data Factory. Every BimlFlex subscription includes BimlStudio. BimlExpress is the free add-in for Visual Studio 2012 to 2019, with BimlExpress for VS Code in preview: write the file loop or the staging pattern once and generate the SSIS packages. BimlStudio is the full IDE for teams with an existing SSIS estate: file layouts in the File Format editor, the project in source control, every package built from the command line, and your SSIS packages imported into Biml.
If youKeep adding channels, and need history, deletes and late data handled in one warehouse on your platform
If youLoad a folder of store files a night in SSIS, and copy a package for every new one
If youRun a large SSIS estate that needs source control, server builds and one place to change every store load