Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do ranking in acumulative % sum 1

Status
Not open for further replies.

juanjoseruiz

Programmer
Apr 24, 2006
4
ES
Hello, i want to do a ranking in a acumulative sum as this example IN BO:

POS NAME SALES SUM % acumulative sum
1 article1 200 200 50,1%
2 article2 150 350 87,8%
3 article3 25 375 94,0%
4 article4 10 385 96,5%
5 article5 9 394 98,7%
6 article6 5 399 100,0%
------------------------------------------
total 399

That I want is as known as PARETO 80%, example over this table.

POS NAME SALES SUM % acumulative sum
1 article1 200 200 50,1%
2 article2 150 350 87,8%
-------------------------------------------

It is a filter over the % acumulative sum.

Please help me, and thanks.
Juanjo Ruiz. Spain.
 
This is probably too hard to achieve. You probably want to show the lines with articles where the last article crosses the threshold of the acumulative 80%.

However, you will not not beforehand if this means 2, 5, or more products.

I think that you would need to write a stored procedure in the database , cause SQL will not help you here.

The stored procedure will allow you to loop through the data and stop when you have crossed the threshold and then return the required set.

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top