Expand my Community achievements bar.

SOLVED

testing for presence of predecessors--text mode

Avatar

Level 7

Hi All,

 

I've created a Task report, and I'm trying to calculate actual durations for tasks in this year's projects (in order to update our templates for next year).  It's been determined that the Actual Duration field is of limited value because in many cases, users marked tasks complete without first clicking on Start Task or changing the status from 'New' to 'In Progress' (causing the Actual Duration to have a value of zero).

 

I've thought of calculating the weekday difference between the task Handoff Date and the Actual Completion Date.  I think this will work if the task actually has a handoff/predecessor.  I'm going to want to create a different calculation (still to be determined) if the task has no predecessor.

 

Could someone please help me create an appropriate IF conditional to test for the presence of a predecessor?  I've looked at both the text mode of the Task>>Predecessors field and the API, but I'm not having any luck correctly identifying tasks that have no predecessors.

 

Thanks,
Kristen

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

hi, since there can be more than one predecessor for a task, you would be looking in the collections tab if you're in the API explorer.

 

If you're familiar with collections syntax, your listmethod would be for "predecessors", and -- this is just a guess -- I assume the if statement would be something along the lines of "If the ID field is blank, do nothing, otherwise do __________" (whatever the thing is you're looking to do). Once you have the calculation for if the task has no predecessor, that would go in the "nothing" area. (Hope that made sense)

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

hi, since there can be more than one predecessor for a task, you would be looking in the collections tab if you're in the API explorer.

 

If you're familiar with collections syntax, your listmethod would be for "predecessors", and -- this is just a guess -- I assume the if statement would be something along the lines of "If the ID field is blank, do nothing, otherwise do __________" (whatever the thing is you're looking to do). Once you have the calculation for if the task has no predecessor, that would go in the "nothing" area. (Hope that made sense)

Avatar

Level 7

I have created reports with collections-based columns, but I don't think I've ever seen a collection itself as the conditional statement to be evaluated.  I'll see if I can get that syntax to work.

 

I ended up creating a conditional to evaluate if the handoff date matches the project start date (which occurs when the task has no predecessor).

 

Thanks!