Hi TheBugSlayer
Thanks for your input, but usually it takes more then 2 items to fill up 60% ratio, actually it's unkwohn how much, so the Top 2 for sure no.
Anyway thank you all, I rearanged my Report and pass it thru VB and fill up my report from, instead of using only SQL, Thanks r937...
Sorry I'm not seeing it with NTile, from what I understood it will divide my rows into sections/Buckets.
But my problem stay the same, I need to know when to stop when my Pourcentage is 60 or more, and here is the ratios
Item...... TotSales..... ItemQty...... TotQty.... RatioQty.... RatioValue...
When I'm searching for the Top Quantity Seller, It should return Item 1 and 2, by this order.
When I'm searching for the top Value Seller, It should return item 3 and 2, by this order also.
The logic is to have the top of the cream from higher to lower, in a pourcentage of top 60%.
Hi again
What I need is to choose the best selling items (By QTY) in my list, they should be in the Top 60% of my total sales Quantity, In this case it returns Item 1 and 2, 39 et 30.
In case I want the best Top 60% of my total Sales (Value), the answer will be Item 3 and 2, 30790.00 and 28540.00
Hi gmmastros
Thanks for your reply, but it's NO GOOD.
Having Sum(Qy) > = 60 will return nothing, it search in the Sum of each item for one >=60
It don't make a sum of the sum and return item 1 and 2.
Sorry no cigar yet.
Hi
I have this query :
Select
Inv.ItemId As Item,
Sum(Inv.RowTotal) As TotSales,
Sum(Qty) as ItemQty,
(Select Sum(Qty) From Invoice) As TotQty
from Invoice Inv
Group by Inv.ItemId
It returns :
Item...... TotSales..... ItemQty...... TotQty
000001... 18510.00..... 39.00......... 90.00...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.