Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to create a column 'Task Ranks' - which ranks each task/item for a user. I need it to be of lowest unique value/integer from all active tasks for that user and to serially generate the next free rank.

e.g. A user has no task - the first task ID 1 for him automatically gets rank 1. Next task ID 2 gets 2. Next task ID 3 gets 3. but if in ID 3 I put rank 1, then ID 1 should automatically become rank 2 and ID 2 should become rank 3. Also if ID 3 is completed, then ID 1 again gets rank 1 and ID 2 gets rank 2 and any new task generated now for this user gets rank 4. This needs to be user specific.

So,

I need a dynamic column which changes value based on value of column with the rank above it.

1 - It needs to apply only to active tasks - completed, deferred, closed should get value nil or '0'.

2 - It needs to be user specific - it should not retain two rank 1 tasks for the same user and entire system of auto-rank population and updation needs to be user-specific.

Any ideas? Tks in Advance!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You're not going to be able to do this with something like a calculated column.

Assuming I have understood what you are trying to achieve correctly, I suggest you order your tasks by their time of creation, filtered by current user id and status. Then compute the "rank" at the point where you display or use the list.

You could create a custom web part to display the list and the calculated rank. You could also compute the rank using XSLT and render the list in an XSLTListViewer. The rank will simply be the position in the list, after ordering by date stamp (using the position() XSLT function).

If you need to retrieve the rank of individual items, create an integer column and create event receivers for item added, item deleted and item changed that will update the rank values of associated tasks.

share|improve this answer
    
great solution ! will try it out. thx –  saumilm Jun 20 '11 at 6:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.