Multiple IF statement to remove roles from list of project users | Community
Skip to main content
Level 2
April 3, 2024
Solved

Multiple IF statement to remove roles from list of project users

  • April 3, 2024
  • 1 reply
  • 735 views

Hi! Back again with another multiple IF statement conundrum. I'm trying to "filter" out the following 3 roles from list of assignees on projects. I'm able to get one to work just fine, but need all 3 removed from the list. Below is what I'm attempting to use but is not removing any of the 3 from my list:

valueexpression=
IF({user}.{roleID}!="6329c33e0012e1aba580831dd37ff97d",{user}.{name},
IF({user}.{roleID}!="632ccd5c00311f932f7100d7e0939e61",{user}.{name},
IF({user}.{roleID}!="632cc9e1003057125fe8730524c07da5",{user}.{name},"")))

 

This single IF statement works just fine:

valueexpression=IF({user}.{roleID}!="632cc9e1003057125fe8730524c07da5",{user}.{name})

 

New to text mode-any help is appreciated!

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 skyehansen

From the calculated data expressions page, we know the syntax of this has to be:

 

 

IF(condition, trueExpression, falseExpression)

 

 https://experienceleague.adobe.com/en/docs/workfront/using/reporting/reports/calculated-custom-data/calculated-data-expressions 

 

Based on your expression above, as soon as you said

 

IF({user}.{roleID}!="6329c33e0012e1aba580831dd37ff97d",{user}.{name}

 

The part before the comma was your condition and your true expression comes immediately after the comma. So you basically are saying "if my user isn't a designer, then tell me what their name is".

 

In cases where you want your user to be none of three things, you have to stack a statement that says, "if my user isn't a designer, then if my user isn't a copywriter, then if my user isn't an art director, then tell me what their name is".

 

So you're more looking to build a statement similar to:

 

valueexpression= IF({user}.{roleID}!="6329c33e0012e1aba580831dd37ff97d", IF({user}.{roleID}!="632ccd5c00311f932f7100d7e0939e61", IF({user}.{roleID}!="632cc9e1003057125fe8730524c07da5",{user}.{name},"")))

 

 

I haven't tested the above, so I don't know if it will work, but this will be similar to what you're looking for. The part before the first comma is still your condition. The part after the first comma is still your true expression but it now contains another IF statement, which means your true expression is made of a condition and a true expression -- and the final true expression is your third IF statement. 

 

The user name can only be considered, if the first two if statements have been successfully passed (it's not one of your first two roles) -- after they have been passed, you can finally filter out the third role.

 

Hope that makes sense.

1 reply

skyehansen
Community Advisor
skyehansenCommunity AdvisorAccepted solution
April 4, 2024

From the calculated data expressions page, we know the syntax of this has to be:

 

 

IF(condition, trueExpression, falseExpression)

 

 https://experienceleague.adobe.com/en/docs/workfront/using/reporting/reports/calculated-custom-data/calculated-data-expressions 

 

Based on your expression above, as soon as you said

 

IF({user}.{roleID}!="6329c33e0012e1aba580831dd37ff97d",{user}.{name}

 

The part before the comma was your condition and your true expression comes immediately after the comma. So you basically are saying "if my user isn't a designer, then tell me what their name is".

 

In cases where you want your user to be none of three things, you have to stack a statement that says, "if my user isn't a designer, then if my user isn't a copywriter, then if my user isn't an art director, then tell me what their name is".

 

So you're more looking to build a statement similar to:

 

valueexpression= IF({user}.{roleID}!="6329c33e0012e1aba580831dd37ff97d", IF({user}.{roleID}!="632ccd5c00311f932f7100d7e0939e61", IF({user}.{roleID}!="632cc9e1003057125fe8730524c07da5",{user}.{name},"")))

 

 

I haven't tested the above, so I don't know if it will work, but this will be similar to what you're looking for. The part before the first comma is still your condition. The part after the first comma is still your true expression but it now contains another IF statement, which means your true expression is made of a condition and a true expression -- and the final true expression is your third IF statement. 

 

The user name can only be considered, if the first two if statements have been successfully passed (it's not one of your first two roles) -- after they have been passed, you can finally filter out the third role.

 

Hope that makes sense.

ColleenKlAuthor
Level 2
April 4, 2024

Totally makes sense! Thank you, Skye. Still really new to the Excel/WF formulas, but learning a lot quickly! All the insight like yours reeeeaaally helps!

 

Unfortunately, the formula didn't work, so now I'm really confused on how to get the data to show correctly!