エンビジョンギャラリーサプライ

エンビジョンとのサンプルサプライヤー分析


ホーム » コマース分析 » このページ

以下のスクリプトは、供給業者の分析ダッシュボードはエンビジョンで構成する方法を示します。

Image

read "/sample1" all

show label "Supply analysis" a1f1 tomato

PurchaseOrders.OrderId = "\{PurchaseOrders.Date}-\{PurchaseOrders.Supplier}"
oend := max(Orders.Date)

// Default currency, and currency conversions
when date >= oend - 365
  currency := mode(Orders.Currency)
Orders.NetAmount = forex(Orders.NetAmount, Orders.Currency, currency, Orders.Date)
PurchaseOrders.NetAmount = forex(PurchaseOrders.NetAmount, \
  PurchaseOrders.Currency, currency, PurchaseOrders.Date)

// Top KPIs
show label "Current year" a2
when date >= oend - 365
  show table "Purchased { \{currency}}" b2 with sum(PurchaseOrders.NetAmount)
  show table "Suppliers" c2 with distinct(PurchaseOrders.Supplier)
  show table "POs" d2 with distinct(PurchaseOrders.OrderId)
  show table "Units purchased" e2 with sum(PurchaseOrders.Quantity)
  show table "Units per order" f2 with \
    avg(sum(PurchaseOrders.Quantity) by PurchaseOrders.OrderId)

show label "Previous year" a2
when date >= oend - 2 * 365 and date < oend - 365
  show table "Purchased { \{currency}}" b3 with sum(PurchaseOrders.NetAmount)
  show table "Suppliers" c3 with distinct(PurchaseOrders.Supplier)
  show table "POs" d3 with distinct(PurchaseOrders.OrderId)
  show table "Units purchased" e3 with sum(PurchaseOrders.Quantity)
  show table "Units per order" f3 with \
    avg(sum(PurchaseOrders.Quantity) by PurchaseOrders.OrderId)

// Linecharts
Week.purchased := sum(PurchaseOrders.NetAmount)
when date < monday(oend) and date >= monday(oend) - 7 * 52
  show linechart "Weekly purchase volumes{ \{currency}}" a4f6 tomato with \
    Week.purchased as "Current year", Week.purchased[-52] as "Previous year"

// Split by supplier
show barchart "Purchase by supplier (1 year){ \{currency}}" a7c9 tomato with \
  sum(PurchaseOrders.NetAmount) \
  group by PurchaseOrders.Supplier

show barchart "Purchase by category (1 year){ \{currency}}" d7f9 tomato with \
  sum(PurchaseOrders.NetAmount) \
  group by Category

// Supplier analysis with lead times
when date >= oend - 365
where PurchaseOrders.DeliveryDate >= PurchaseOrders.Date // delivered PO only
  show table "Supplier analysis (1 year)" a10f13 tomato with \
    PurchaseOrders.Supplier as "Supplier", \
    distinct(PurchaseOrders.OrderId) as "POs", \
    avg(mode(PurchaseOrders.DeliveryDate - PurchaseOrders.Date) \
      by PurchaseOrders.OrderId) as "Supplier Lead Time{ days}", \
    365 / distinct(PurchaseOrders.OrderId) as "Ordering Lead Time{ days}", \
    avg(sum(PurchaseOrders.NetAmount) \
      by PurchaseOrders.OrderId) as "Avg POs amount{ \{currency}}", \
    avg(sum(PurchaseOrders.Quantity) by PurchaseOrders.OrderId) as "Avg POs units" \
    group by PurchaseOrders.Supplier \
    order by sum(PurchaseOrders.NetAmount) desc