Expand my Community achievements bar.

SOLVED

Add a rating column

Avatar

Level 2

Hello,

 

I am trying to add a rating column based on the impact level on an issue report. I have created an IF statement for the column in text mode to look at the level and assign a number, but it doesn't seem to work. I am not sure if my IF statement format is incorrect, or if there is a better way to do this? Any help is greatly appreciated.

 

If statement in Text Mode:

displayname=Change Capacity Measure
textmode=true
usewidth=true
valueexpression=IF({DE:FIA_ImpactLevel}="Low Impact","2",IF({DE:FIA_ImpactLevel}="Medium Impact","6",(IF({DE:FIA_ImpactLevel}="High Impact","9","")"")"")
valueformat=html
width=33

 

AnnieXLe_0-1698446598713.png

 

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 3

how interesting. I copied your code straight out to use with one of my fields, and the following did produce the expected results:

displayname=Change Capacity Measure
textmode=true
usewidth=true
valueexpression=IF({DE:my_fieldname}="one of my choices","2")
valueformat=html
width=33

 

(You can see I didn't even bother with the entire statement -- what to do if it is false)

I would say if this doesn't work on your side, it's acceptable to use CONCAT, i.e. valueexpression=IF({DE:my_fieldname}="one of my choices",CONCAT("2")) -- sometimes this produces a better result. Other than that though, you should be double checking the field name and choices to make sure you're not somehow typoing (I assume you're not)

View solution in original post

5 Replies

Avatar

Level 3

Your syntaxing is incorrect but you would be most helped by being able to troubleshoot effectively. Start off with your initial logic statement, which is 

 

IF(X=Y,"do this thing","otherwise, do that thing") 

 

Test this one thing, and if it works, then understand that in order to add to it, you ONLY need to sub out the "otherwise" sentence for the exact same logic statement.

 

In other words, your first test would have been: IF({DE:FIA_ImpactLevel}="Low Impact","2","") -- you would want to get this working before you do anything else.

 

If you can get this to work, your next attempts would look like this:

IF(X=Y,"do this thing", IF(X=Z,"do this other thing","otherwise, do that thing")) 

IF(X=Y,"do this thing", IF(X=Z,"do this other thing",IF(X=A,"do this other other thing","otherwise, do that thing"))) 

 

Rafal just gave another example of how this sort of syntaxing should look in this other post:

https://experienceleaguecommunities.adobe.com/t5/workfront-questions/creating-a-calculated-field-tha...

Avatar

Level 2

I have tried your recommendation to firs test the one IF statement : IF({DE:FIA_ImpactLevel}="Low Impact","2","") and it did not work. I'm not sure if I need to define a syntax before "Low Impact" since it is one of three options from DE:FIA_ImpactLevel field. 

Avatar

Correct answer by
Level 3

how interesting. I copied your code straight out to use with one of my fields, and the following did produce the expected results:

displayname=Change Capacity Measure
textmode=true
usewidth=true
valueexpression=IF({DE:my_fieldname}="one of my choices","2")
valueformat=html
width=33

 

(You can see I didn't even bother with the entire statement -- what to do if it is false)

I would say if this doesn't work on your side, it's acceptable to use CONCAT, i.e. valueexpression=IF({DE:my_fieldname}="one of my choices",CONCAT("2")) -- sometimes this produces a better result. Other than that though, you should be double checking the field name and choices to make sure you're not somehow typoing (I assume you're not)

Avatar

Level 3

ah, good going. So now you only have to repeat it another two times, while paying attention to your parentheses :). Good luck to you!