How do I add another status to this project collection expression? | Community
Skip to main content
MoniqueEvans
Community Advisor
Community Advisor
December 28, 2023
Solved

How do I add another status to this project collection expression?

  • December 28, 2023
  • 2 replies
  • 827 views

I'm working on a program report and want to add a column for active projects. I am 75% of the way there but need to edit my collection text mode to also include when a project's status is in Planning (PLN)

 

displayname=Current Projects listdelimiter=<div> listmethod=nested(projects).lists textmode=true type=iterate usewidths=true valueexpression=IF(CONTAINS('CUR',{status})=false," ",CONCAT({name},' : ',{owner}.{name})) valueformat=HTML width=300
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by RandyRoberts

Hi Monique,

Your approach is the culprit here as CONTAINS isn't the most efficient way to get this info. Also, your parens weren't in the right place.

 

 

 

 

displayname=Show Owner if Planning or Active listdelimiter=<div> listmethod=nested(projects).lists textmode=true type=iterate valueexpression=IF({status}="CUR" || {status}="PLN",CONCAT({name}," : ",{owner}.{name})," ") valueformat=HTML

 

Use the || operator to indicate that the condition is fulfilled when the expression finds either the first or the second value of your statement.

For example, use the following statement in a calculated custom field to build an “IF” statement that marks projects in either the Current or Planning statuses as “Active”:

IF({status}=”PLN”||{status}=”CUR”,”Active”,”Not Active”)

TIP: if this solved your problem, I invite you to consider marking it as a Correct Answer to help others who might also find it of use.
If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/mysocalledideas

 

2 replies

Madalyn_Destafney
Community Advisor
Community Advisor
December 29, 2023

Hi there! I'm pretty sure you'd add another IF within the statement you have so you're expression looks for projects in Current and Planning. This is the structure for combining IF statements:

IF(Condition1,True Expression,IF(Condition2,True Expression,False Expression))

Does this work for you?

valueexpression=IF(CONTAINS('CUR',{status})=false," ",CONCAT({name},' : ',{owner}.{name}),IF(CONTAINS('PLN',{status})=false," ",CONCAT({name},' : ',{owner}.{name})))

 

 

If this helped you, please mark correct to help others : )
MoniqueEvans
Community Advisor
Community Advisor
December 30, 2023

Thanks, Madalyn. Unfortunately, that doesn't work and I only see the Current projects.

RandyRoberts
Community Advisor
RandyRobertsCommunity AdvisorAccepted solution
Community Advisor
January 1, 2024

Hi Monique,

Your approach is the culprit here as CONTAINS isn't the most efficient way to get this info. Also, your parens weren't in the right place.

 

 

 

 

displayname=Show Owner if Planning or Active listdelimiter=<div> listmethod=nested(projects).lists textmode=true type=iterate valueexpression=IF({status}="CUR" || {status}="PLN",CONCAT({name}," : ",{owner}.{name})," ") valueformat=HTML

 

Use the || operator to indicate that the condition is fulfilled when the expression finds either the first or the second value of your statement.

For example, use the following statement in a calculated custom field to build an “IF” statement that marks projects in either the Current or Planning statuses as “Active”:

IF({status}=”PLN”||{status}=”CUR”,”Active”,”Not Active”)

TIP: if this solved your problem, I invite you to consider marking it as a Correct Answer to help others who might also find it of use.
If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/mysocalledideas

 

MoniqueEvans
Community Advisor
Community Advisor
January 2, 2024

You're my hero!! In all my years I've never needed to use an IF || statement.

 

Also your upvote link is genius