I am trying to get the Order Count for Items and Products,and am running into a problem.
I have a query that gets the count of distinct orders for each item.(Select Item_Key,count(distinct order_no from orders group by item_key).This count needs to be rolled up to the Product Line Level. This seems fairly staright forward. But consider this situation.
Order No:1234 has 5 Items (I1,I2,I3,I4,I5). The query would show 1 Order for each of these Items. All these Items fall under one Product Line P1. When I rollup to Product Line level, it shows as 5 Orders for product line P1. But actually it should be only 1 order.
How can this be resolved?
Thanks for the help.
I have a query that gets the count of distinct orders for each item.(Select Item_Key,count(distinct order_no from orders group by item_key).This count needs to be rolled up to the Product Line Level. This seems fairly staright forward. But consider this situation.
Order No:1234 has 5 Items (I1,I2,I3,I4,I5). The query would show 1 Order for each of these Items. All these Items fall under one Product Line P1. When I rollup to Product Line level, it shows as 5 Orders for product line P1. But actually it should be only 1 order.
How can this be resolved?
Thanks for the help.