Data & AIClient engagement

AI Demand Planning Engine

Reorder quantities were being estimated from spreadsheets that were stale before they were finished. Marsos built a pipeline that combines sales, distributor and inventory data into one demand signal, applies the client's own ordering rules to it, and writes suggested quantities back into Salesforce — so a rep opens the storefront and the order is already filled in.

Salesforce B2B CommerceTableau PrepTableau CloudGoogle CloudPythonPandasSalesforce Bulk API 2.0

Delivery signals

Demand planning & suggestive-order pipeline

Pre-filled orders

suggested quantities waiting in the storefront, not in a spreadsheet

One signal

own sales, distributor sales and stock on hand combined

Client's own rules

case packs and minimum order quantities applied per product

Closed loop

recommendations land back in the tools reps already use

01 / Context

The operating environment

The demand-planning programme needed a closed loop between primary sales in Salesforce, distributor secondary-sales files, inventory, demand drivers, forecasting, business rules, BI dashboards, and suggested orders in the B2B storefront.

02 / Business outcome

What changed for the client

The result this engagement delivered — before any of the engineering behind it.

01

Unified primary sales, secondary sales, inventory, and demand drivers into one forecasting signal.

02

Automated business-rule-validated suggested reorder quantities per product and account.

03

Closed the loop by writing recommendations back to Salesforce and presenting pre-filled suggested orders in the B2B storefront.

04

Produced Tableau consumption layers for distributor performance, coverage, and executive KPI monitoring.

03 / Challenge

Complexity before transformation

01

Primary sales, distributor secondary sales, inventory, and demand-driver data arrived from different systems and formats.

02

The forecasting layer needed cleaning, joins, date buckets, aggregation, seasonality, growth factors, and business-rule validation.

03

Suggested quantities had to respect minimum order quantities, case packs, classifications, stock coverage, lead time, and Make-to-Order or Make-to-Stock behaviour.

04

Results needed to return to Salesforce for account-and-product-specific storefront recommendations while also feeding Tableau analysis.

04 / Delivery

What Marsos engineered

01

Built a Tableau Prep flow that unifies Salesforce and spreadsheet inputs, resolves duplication, and prepares forecast-ready data.

02

Implemented forecast calculations and a business-rules engine for minimum order quantity, case-pack optimization, classification, inventory coverage, and lead time.

03

Generated machine-readable CSV outputs for Python injection and Hyper extracts for Tableau dashboards.

04

Built a Google Cloud and Python integration bridge using schema validation, type transformation, retry logic, logging, and Bulk API 2.0 upsert into Salesforce.

05 / How it works

End-to-end data flow

The system, one step at a time — the sequence that carries an order, a shipment or a decision from start to done.

  1. 01

    Data sources

    Primary sales, distributor secondary sales, on-hand inventory and demand drivers — seasonality and promotions — enter one load pipeline.

  2. 02

    Analytics and transformation

    Tableau Prep joins, cleans and aggregates, then the forecast algorithm and business-rules engine compute suggested quantities.

  3. 03

    Output layer

    Machine-readable CSV extracts for injection and Hyper star-schema extracts for BI.

  4. 04

    Integration bridge

    Google Cloud middleware and a Python loader validate schemas, transform types and UPSERT into Salesforce with retry logic and external-ID matching.

  5. 05

    Consumption

    Distributors see pre-filled suggested orders in the B2B storefront; executives track coverage and KPIs in Tableau dashboards.

06 / System Architecture

Architecture revealed as a system story.

Scroll through the technical decisions to see how each platform layer connects to the next.

Demand planning & suggestive-order pipeline
Demand planning & suggestive-order pipelineOpen full-size diagram ↗

The full path from raw sales data to a pre-filled order in the distributor storefront: sources blended into one demand signal, the forecast and the client's own ordering rules applied, then results written back to Salesforce and Tableau. Client, brand, warehouse and region identifiers removed; sample data genericised.

Active decision

Used a closed-loop Salesforce to Tableau to Python to Salesforce flow rather than a disconnected forecasting report.

01

Architecture decision

Used a closed-loop Salesforce to Tableau to Python to Salesforce flow rather than a disconnected forecasting report.

02

Architecture decision

Matched suggestion records by external account-and-product identifiers for repeatable upsert and conflict handling.

03

Architecture decision

Kept forecast inputs, business-rule outputs, CRM records, storefront consumption, and BI dashboards aligned.

04

Architecture decision

Removed client, warehouse, distributor, region, and endpoint identifiers from the public reference architecture.

07 / Engineering highlights

Where the hard problems were won

The proof points a technical buyer should inspect first.

Impact

Unified demand signal

Salesforce primary sales blend with distributor secondary sales into one forecasting dataset via Tableau Prep — outlier-adjusted and projected forward with growth factors.

Impact

Automated suggestive ordering

A forecast algorithm plus a business-rules engine — MOQ rounding, case-pack optimization, classification — derives preset reorder quantities per SKU.

Impact

Closed-loop CRM and BI

Python with Bulk API 2.0 UPSERT writes results back into Salesforce; Hyper extracts feed Tableau dashboards — one pipeline serving both.

Impact

Distributor self-service

The B2B storefront surfaces a Suggested Order page pre-filled with recommended quantities, keyed per account and product.

08 / Platform surface

The capability map

Planning parameters

MSL / SMI stocking policyMTO / MTS order modes60–90 day production lead timesTransit-aware arrival planningDOS / MOS coverage targets

09 / Technology

The delivery stack

01

Salesforce B2B Commerce

02

Tableau Prep

03

Tableau Cloud

04

Google Cloud

05

Python

06

Pandas

07

Salesforce Bulk API 2.0

08

OAuth 2.0

Confidentiality protocol

Use generic data only. Do not expose client, brand, distributor, warehouse, region, table, file, or endpoint identifiers from production systems.

Build with Marsos

Bring us the difficult system.We will make it buildable.

Start with a clear technical direction, an architecture that can scale, and a delivery plan your team can trust.