Not strictly Progress

Cringer

ProgressTalk.com Moderator
Staff member
Don't know if anyone can help... I'm posting this in here as I'm not writing progress. It's more of a logic question too...

I have a list of items in a database table. They all have a rank. Based on certain criteria I want to demote certain items in the list. Can anyone help me with establishing the logic to achieving this? It sounds quite simple at first, but it gets quite confusing. Some examples using items ranked 1,2,3,4,5.

a) Rank 3 is to be demoted. It moves to rank 4, and rank 4 is promoted to rank 3.
b) Rank 5 is to be demoted. There's nowhere to go so it stays.
c) Rank 3 and 4 are to be demoted. Rank 5 becomes rank 3 and ranks 3 and 4 drop a rank.
d) Rank 4 and 5 are to be demoted. Nothing happens as there is nowhere to go.

Any thoughts? I'm getting rather bogged down!!
 

Cringer

ProgressTalk.com Moderator
Staff member
Ah I've had a brain wave. Rather than working out who to demote, work out who to promote. It seems to work nicely! :)
 

amandak695

New Member
What's up everyone, I'm new to the forum and just wanted to say hey. Hopefully I posted this in the right section!
 

domlucas

New Member
as you seem to have sorted this, the answer may not be useful, but here goes .. change the ranks to hundreds (1 becomes 100, 2 becomes 200, etc). then you can move the ranks to the required location without a reindex (300 moves to 450, 500 goes to 300). You display the rank if needed as a count (so first is count 1, second count 2,etc).

At some stage you need to do a reorg, but that's quite simple.

Hope it helps
 

fraulgarcag

New Member
I am not able to see pictures posted by other users in certain threads. I used to see it before but somehow i cant now. Do i have to change any settings? Please help me
 
Top