// EXECUTION_PIPELINE

Implementation Pipeline

Our engine handles the complexity of data movement while you focus on high-level decision logic.

PHASE_1 // COGS Integration

Sync cost of goods directly from Shopify inventory or map them via external CSVs.

PHASE_2 // Blended Spend

Automatically subtract Meta, Google, and TikTok ad spend from your gross margin to reveal true net.

PHASE_3 // Discount Auditing

See exactly how much margin is destroyed by stackable discount codes and influencer promos.

// STRATEGIC_SCENARIO

Deep Data Retrieval

How Arcli grounds AI in your exact schema to generate highly-optimized, dialect-specific execution logic.

The Engine Room: True Margin Calculation

How Arcli structurally subtracts all operational costs to find the real profit floor.

THE EXECUTIVE FILTER (ROI)

Prevents the fatal error of scaling top-of-funnel campaigns that are secretly draining corporate cash reserves.

  • Fully optimized for DuckDB SQL constraints.
  • Bypasses semantic layer hallucinations via strict schema grounding.
DuckDB SQL_COMPILE
-- Generated by Arcli Semantic DAG
SELECT 
    o.order_id,
    o.total_price AS gross_revenue,
    COALESCE(c.cogs, 0) AS total_cogs,
    o.total_discounts AS discounts,
    -- Subtracting Costs for CM1
    (o.total_price - COALESCE(c.cogs, 0) - o.total_discounts) AS cm1,
    -- Subtracting Blended Ad Spend (CAC) for CM2
    ((o.total_price - COALESCE(c.cogs, 0) - o.total_discounts) - a.blended_cac) AS cm2_net_profit
FROM tenant_workspace.shopify.orders o
LEFT JOIN tenant_workspace.finance.daily_cogs c ON o.id = c.order_id
LEFT JOIN tenant_workspace.marketing.daily_cac a ON DATE_TRUNC('day', o.created_at) = a.date
WHERE o.financial_status = 'paid';