I havent tried anything as of yet, here is where I have got to: create table join1 as
select a.name,
b.quantity,
c.uk,
c.eu,
c.us,
c.amea
from work.product a
full join work.stock c
on a.product_id = c.product_id
full join work.order_product b
on a.product_id = b.product_id
;
create table sort1 as
select distinct name, sum(quantity) as number_of_sales, uk, us, eu, amea
from join1
group by name
order by number_of_sales desc
;
proc sql outlobs=3;
create view top_three as
select name, number_of_sales
from sort1; my last piece isnt working as I would expect, it is listing all rows rather than just the top 3. I do not know how to alter the view.
... View more