sales_walk/sql/excel_query.sql

24 lines
455 B
MySQL
Raw Normal View History

2023-10-18 15:00:33 -04:00
SELECT
sw.bill_dba,
sw.ship_dba,
sw.dsm,
sw.budget_2024,
sw.shipments_2023,
sw.shipments_2024,
sw.open_orders_2024,
sw.quotes,
--(shipments_2024 + open_orders_2024) - shipments_2023 yoy_delta,
(shipments_2024 + open_orders_2024) - budget_2024 yoy_delta,
sw.flag,
sw.bucket,
sw.attainment,
sw.notes
FROM
rlarp.sales_walk_r1 sw
WHERE
(sw.dsm = ?)
ORDER BY
sw.shipments_2023 desc,
shipments_2024 + open_orders_2024 desc,
quotes desc