proc sql; create table MostPopularRouterByState as select c.State, o.SKU, count(o.OrderID) as TotalOrders from DATA_ELE.ORDERS o inner join DATA_ELE.CUSTOMERS c on o.CustomerID = c.CustomerID group by c.State, o.SKU having calculated TotalOrders = (select max(calculated TotalOrders) from DATA_ELE.ORDERS o2 inner join DATA_ELE.CUSTOMERS c2 on o2.CustomerID = c2.CustomerID 77 where c.State = c2.State 78 group by c2.State, o2.SKU) 79 order by c.State, TotalOrders desc; ERROR: Summary functions nested in this way are not supported.
... View more