-- Total Unique Distributor Products
-- Total Unique products in deal_product
-- FILTER: {
--   filter: "date",
--   column: "Send_Date",
--   params: {
--     "format": "m/d/y"
--   }
-- }
-- FILTER: {
--   filter: "class",
--   column: "active_products",
--   params: {
--     class: "text-right"
--   }
-- }
-- FILTER: {
--   filter: "class",
--   column: "inactive_products",
--   params: {
--     class: "text-right"
--   }
-- }

SELECT to_char(count(dp.location_id), '999,999,999,999') AS active_products
FROM simplebrsprod.deal_product dp, simplebrsprod.business_location bl
WHERE dp.location_id = bl.id
  AND dp.polyclass = 'BaseProduct|Product'
  AND bl."polyclassC" = 'LocationWholesaleDistributor'


