Link to home
Start Free TrialLog in
Avatar of ScubeduFan
ScubeduFanFlag for United States of America

asked on

Ranking Based On Value

I know how to do basic ranking, but is it possible to do it based on a sum of a value?

Using the small subset of data below, my goal is to sum up the "DescValue" column and every SUM of 5, I would increment the "Page" number. The "Page" must increment to never allow the sum of "DescValue" on a page to be greater than 5.

I am using MS SQL 2014.

Description            DescValue      Page
Line1                   1                  1
Line2                   2                  1
Line3                  1                  1
Line4                  2                  2
Line5                  3                  2
Line6                  2                  3
Line7                  4                  4
Line8                  1                  4
Line9                  1                  5
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

ok got it , working. Good One Vitor :) and I totally take that back.

Regards,
Pawan
ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ScubeduFan

ASKER

Works great! Thank You!!!