ScubeduFan
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works great! Thank You!!!
Regards,
Pawan