Negative IF ELSE statements v positive ones. List a specific task in a project report. (working code included)
I've noticed some folks prefer to use "not true" IF statements when creating list type columns as opposed to listing the results if true.
Is there some benefit to this or is it just preference? Here's are examples of listing a specific task in a project report:
Not True Statement:
displayname=Task Name Not True
listdelimiter=<div>
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF({name}!="Task Name","",CONCAT({name}," | ",{assignedTo}.{name}," ",{plannedCompletionDate}))
valueformat=HTML
width=200
True Statement:
displayname=Task Name True
listdelimiter=<div>
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF({name}="Task Name",CONCAT({name}," | ",{assignedTo}.{name}," ",{plannedCompletionDate},""))
valueformat=HTML
width=200
As you can see the first statement does nothing if the name=Task Name is NOT true, else it lists lists the task, assignee, due date.
The second example lists the task, assignee, due date if the name=Task Name IS true, else it does nothing.
I see more of the NOT true types in examples and posts than the TRUE one.
Does anyone prefer one over the other? and why?
I bet @Anthony Imgrund‚ and @Doug Den Hoed‚ have an opinion!
Either way, this an example of code some folks might find useful!
