# Binzagr simulated datasets — sim_v1

Window 1 Mar – 20 Oct 2026 (234 days), Riyadh van sales plus four simulated channels. Seed 20261027. Built 27 Oct 2026.

## Rules every table follows
- Real Binzagr data is kept unchanged. Grocery (GR) sell-in is the 325,544 real invoice lines, SAR 40.4M; route calls with a sale, van sold/free/returned quantities and the Jeddah attendance file are actuals.
- Everything else is simulated around real keys: outlet_id = dist_cd-cust_cd (twins merged onto one main code), sku = prd_cd, van_id = slsman_cd.
- Every row has `basis` (Actual / Inferred / Simulated) and `sim_version`. All parameters are in `parameters.csv`.
- No personal names. Reps and warehouse staff appear as codes only. Accounts, platforms and competitors are fictional (Key account 01, Platform A, Competitor A).
- Planted problems carry an `anomaly_label` so detection models can be scored (see `_anomaly_ground_truth.csv`).

## Files
Each table is a .parquet file (use this) plus a .csv copy (.csv.gz above 200K rows). `_data_dictionary.csv` lists every column with type, null share and an example; the full column meanings are in 09_Simulation_Spec.

| Table | Rows | Cols | Basis |
|---|---:|---:|---|
| dim_account | 4,607 | 15 | Actual 4,531, Simulated 76 |
| dim_channel | 5 | 8 | Simulated 4, Actual 1 |
| dim_competitor_product | 600 | 11 | Simulated 600 |
| dim_employee | 187 | 8 | Actual 119, Simulated 68 |
| dim_outlet | 4,979 | 16 | Actual 4,415, Simulated 564 |
| dim_product_ext | 1,038 | 24 | Inferred 1,008, Simulated 30 |
| dim_route | 119 | 14 | Inferred 119 |
| dim_vehicle | 119 | 8 | Simulated 119 |
| fact_account_escalation | 155 | 12 | Simulated 155 |
| fact_action_log | 2,548 | 13 | Simulated 2,548 |
| fact_competitor_activity | 868 | 11 | Simulated 868 |
| fact_credit_block | 503 | 11 | Simulated 503 |
| fact_customer_stock | 26,968 | 10 | Simulated 26,968 |
| fact_deduction_dispute | 1,058 | 13 | Simulated 1,058 |
| fact_demand_plan | 18,900 | 13 | Simulated 18,900 |
| fact_ecom_listing_daily | 234,000 | 18 | Simulated 234,000 |
| fact_inventory_weekly | 139,386 | 17 | Simulated 139,386 |
| fact_manager_time | 3,618 | 6 | Simulated 3,618 |
| fact_meeting | 1,450 | 10 | Simulated 1,450 |
| fact_merch_visit | 24,431 | 14 | Simulated 24,431 |
| fact_open_invoice | 14,609 | 10 | Simulated 14,609 |
| fact_order_fulfilment | 403,995 | 23 | Simulated 403,995 |
| fact_price_observation | 394,215 | 13 | Simulated 394,215 |
| fact_promo_execution | 45,400 | 11 | Simulated 45,400 |
| fact_promotion | 1,680 | 15 | Simulated 1,680 |
| fact_purchase_order | 347,900 | 18 | Simulated 347,900 |
| fact_receipt | 86,157 | 14 | Simulated 86,157 |
| fact_route_visit | 94,640 | 19 | Actual 68,984, Simulated 25,656 |
| fact_sales_target | 26,337 | 12 | Simulated 26,337 |
| fact_sales_target_daily | 58,450 | 6 | Simulated 58,450 |
| fact_sell_in | 729,539 | 25 | Simulated 403,995, Actual 325,544 |
| fact_sell_out | 114,614 | 12 | Simulated 114,614 |
| fact_shelf_audit | 525,125 | 17 | Simulated 525,125 |
| fact_team_attendance | 27,092 | 10 | Simulated 27,092 |
| fact_trade_spend | 685 | 17 | Simulated 685 |
| fact_van_cash | 10,907 | 10 | Simulated 10,907 |
| fact_van_stock | 313,628 | 14 | Simulated 313,628 |
| fact_warehouse_attendance_jeddah | 58,634 | 14 | Actual 58,634 |

## Task → table map

| # | Task | Tables |
|---|---|---|
| 1 | Sell-in vs daily target | fact_sell_in, fact_sales_target_daily |
| 2 | MTD run rate vs target | fact_sell_in, fact_sales_target |
| 3 | Channel mix vs plan | fact_sell_in, dim_channel |
| 4 | Sell-out | fact_sell_out |
| 5 | POs received vs expected, rejected, delayed | fact_purchase_order |
| 6 | Merchandiser photo reports | fact_merch_visit, fact_shelf_audit |
| 7 | Promotions live | fact_promotion, fact_promo_execution |
| 8 | Wholesale price levels | fact_price_observation (WS invoice prices) |
| 9 | Abnormal or irregular orders | fact_sell_in (anomaly_label) |
| 10 | Discounter shelf vs MT prices | fact_price_observation (DS vs MT shelf) |
| 11 | Pack and SKU compliance | fact_shelf_audit (channel_pack_breach), dim_product_ext |
| 12 | Calls, strike rate, drop size | fact_route_visit |
| 13 | New and lost outlets, must-sell coverage | dim_outlet (status, open/close dates), dim_product_ext must_sell, fact_sell_in |
| 14 | Van stock, cash and credit reconciliation | fact_van_stock, fact_van_cash |
| 15 | Orders by platform, OOS, inactive listings | fact_ecom_listing_daily |
| 16 | Search rank, ratings, ad return | fact_ecom_listing_daily |
| 17 | Promotion uplift vs plan | fact_promotion (planned vs sim_true uplift), fact_sell_in |
| 18 | Trade spend vs budget and claims | fact_trade_spend |
| 19 | Competitor launches and price cuts | fact_competitor_activity, dim_competitor_product |
| 20 | Warehouse stock cover vs forecast | fact_inventory_weekly, fact_demand_plan |
| 21 | Fill rate and OTIF with cut reasons | fact_order_fulfilment |
| 22 | Customer stock, near-expiry, pending returns | fact_customer_stock, fact_inventory_weekly (days_to_expiry) |
| 23 | Demand shifts to planning | fact_demand_plan |
| 24 | Overdue receivables and credit blocks | fact_open_invoice, fact_receipt, fact_credit_block |
| 25 | Claims, deductions and disputes | fact_deduction_dispute, fact_trade_spend |
| 26 | Key account escalations | fact_account_escalation |
| 27 | Uncovered routes, absent merchandisers | fact_team_attendance (route_uncovered, cover_employee_id), fact_merch_visit |
| 28 | KAM and supervisor meetings | fact_meeting |
| 29 | Action log and approvals | fact_action_log |
| 30 | Where the manager spends time | fact_manager_time, fact_meeting |

## Calibration achieved

- GR sell-in value = real Riyadh sales: 40,409,419 vs 40,409,419
- GR sell-in rows = real invoice lines: 325,544 vs 325,544
- channel mix (plan GR .40 MT .30 WS .15 DS .08 EC .07): DS 0.08 EC 0.07 GR 0.4 MT 0.299 WS 0.151
- GR open AR = real 20-Oct outstanding (mapped outlets): 3,478,454 vs 3,824,669 (all codes)
- strike rate (target 0.70–0.85): 0.765
- OTIF lines / line fill: 0.905 / 0.966
- Foreign keys: 54 joins checked, all ≥ 99.9% match.
- Strike rate 76.5%; promo live rate 84%; sell-out OOS 11.7%; e-com inactive listings 3.8%; warehouse SKU-weeks with unfilled demand 2.4%; stat forecast accuracy (1 − WAPE, 1 month) 72%.
- Credit blocks hit 360 customers (about 10% of credit customers); 22% released by manager override.

## Planted anomalies

- fact_merch_visit: checkin_far_from_store — 150 rows
- fact_price_observation: ds_below_mt_price — 60 rows
- fact_price_observation: ws_below_floor — 53 rows
- fact_route_visit: gps_far_from_outlet — 120 rows
- fact_sell_in: price_below_floor — 90 rows
- fact_sell_in: large_irregular — 60 rows
- fact_sell_in: parallel_trade — 40 rows
- fact_shelf_audit: channel_pack_breach — 300 rows
- fact_van_cash: cash_short — 217 rows
- fact_van_stock: stock_unexplained_loss — 928 rows

## Differences from the spec and known limits
- Inventory is a weekly snapshot by lot (`fact_inventory_weekly`), not daily, to keep volume sensible; lead times by division are assumptions.
- F14 is split into `fact_van_stock` and `fact_van_cash`. Extra tables: `fact_sales_target_daily`, `fact_open_invoice` (AR ageing at 20 Oct), `fact_manager_time` (manager diary), `fact_warehouse_attendance_jeddah` (real scans, codes only).
- Grocery open AR reproduces the real 20 Oct balances for outlets that appear in sales (SAR 3.48M of 3.82M; the rest sits on codes with no sales in the window).
- Our twin merge gives 430 twins / 4,531 outlets; the app uses 465 / 4,535.
- Modern trade, wholesale, discounter and e-commerce volumes come from the assumed channel mix. Ask Binzagr for real figures before any number from these channels goes to the client.
- Supplier lead times, payment behaviour mix, deduction rates and the meeting and time-use patterns are assumptions; their values are in `parameters.csv` or at the top of each stage script.