Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!
SOLVED

Multiple IF statement to remove roles from list of project users

Avatar

Level 2

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!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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/... 

 

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.

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

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/... 

 

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.

Avatar

Level 2

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! 

Avatar

Level 2

Nope I totally lied - it worked!! I went back to the formula and realized I left a space. Thank you for your insight, Skye!!

Avatar

Community Advisor

welp, now you know that if you understand the way the syntax should work, you can guess at an answer! LOL Good, I'm glad that worked out for you without too much trouble.