Margin & Mix
Ask what happened to margin, why it moved, who caused it, and what a promotion would cost.
Every figure is calculated in your data and checked before you see it.
The half closed and someone asks how margin did.
“What was revenue, gross profit, and the gross margin rate in the first half of 2018?”
Knowing gross profit moved is not useful. Knowing what moved it is.
“Why did gross profit change in the first half of 2018 compared with the second half of 2017?”
An aggregate is not actionable. You need names for the supplier.
“Which products hurt gross profit the most in the first half of 2018 versus the second half of 2017?”
You are considering a promotion and need to know what it costs.
“If we ran an extra 10 points of discount on toys in the first half of 2018, what would it have cost in gross profit and how much more volume would we have needed to break even?”
Nothing here predicts the future, so it does not pretend to.
“What will our gross margin be next quarter?”
Sometimes the honest answer is that the slice is empty.
“For key accounts, split the gross profit change from the second half of 2017 to the first half of 2018 into price, discount, cost, volume, and mix.”
The model never computes a number
- It picks from seven typed, read-only tools. No SQL, no connection, no credentials.
- The database computes. Gross profit, the margin bridge, the promotion scenario, all in exact decimals.
- Every figure is checked against what the tools returned. An invented number is regenerated once, then refused.
- A weak answer escalates to a larger model automatically.
Size is a database question, not an AI one
The model never sees a row, only a twenty-row ranking or six bridge numbers. 98,083 rows aggregate in about 15 ms, and the same design holds at millions.
What is real here
Revenue, identifiers, dates, categories and states are public Olist facts. Cost, list price, discount, channel and segment are generated, so the margins are illustrative.