IF expression in calculated field | Community
Skip to main content
Level 2
March 18, 2022
Question

IF expression in calculated field

  • March 18, 2022
  • 1 reply
  • 594 views

Hello! Is it possible to use predecessor planned completion date in an IF expression.

We are trying to create an expression that will highlight a line in red if the planned completion date does not match the predecessor planned completion date.

IF(Planned Completion Date!=Predecessor Planned Completion Date,"Yes","No") is a invalid expression. Am I missing something?

Thank you!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

RandyRoberts
Community Advisor
Community Advisor
March 23, 2022

Hmmm...

This works in an assignments report column:

displayname=Date Match

namekey=task

textmode=true

valueexpression=IF({plannedCompletionDate}!={predecessor}.{plannedCompletionDate},"yes","no")

valueformat=HTML

That being said, I have not been able to successfully use text based expressions (IF, CONCAT, etc) on date/time calcs in a form. If you even DID get it to work, it would not honor the standard time zone rules as all text based calcs use the default time zone when referencing dates.

This doesn't say invalid expression but it still doesn't work:

IF(Planned Completion Date=Actual Completion Date,"yes","no")

I suspect it's because the predecessor date is a reference and form calc won't even entertain that.

Because Workfront hasn't remedied this, I would suggest a report-based calculation rather than form-based.

But if you do get anything to work, I'd love to hear how it's done.