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!
Topics help categorize Community content and increase your ability to discover relevant content.
Hi - I'll be 100% honest, I have never used !=. If I want "does not equal", I just switch the true and false sections of the IF statement.
Thanks Anthony,
I agree. I prefer the IF TRUE statements in most cases, much less confusing. I just wanted to know if there was some reasoning I was missing.
Views
Replies
Total Likes
I don't use the shorthand (!=) mostly for clarity. Someone less math- or programming-nerdy may need to look at what I did and not know about the symbology. 😁
I'll use IF TRUE or IF FALSE variants depending on:
It's difficult to explain; after doing various forms of programming in various languages, script systems, etc. I just do what feels right, more efficient, more readable, whatever.
My brain works much the same. 'How can I write this so when I'm trying to figure out how to modify it 6 months from now it still reads as plain language where my intent was common?'
I'm curious if there's a way to modify this so it brings back all tasks under a certain parent task. I hesitate to match on task names since I can't guarantee people won't change them.
Views
Replies
Total Likes