Expand my Community achievements bar.

SOLVED

Calculated field on Selection of another field.

Avatar

Level 2

I want to set up a calculated field to have a pre-set value based on a selection of another field (radio button). So suppose one radio button have 4 options a,b,c and d, I want to have a calculated field that shows 1 for a, 2 for b, 3 for c and d.

Is it possible?

 

Thanks,

Nisha

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks, this is working for me  

View solution in original post

7 Replies

Avatar

Community Advisor

This is possible but the caveat is the form has to be refreshed before any calc takes place. This is usually done by selecting "Recalculate Expressions" from the elipsis menu on the Project.

Avatar

Level 10

Possible to get the code for the same?

Avatar

Level 2

Yes Please.

Avatar

Employee

Fields:

Radio Type = A, B, C, D

Calculated field = 

IF({DE:Radio Type}="A","1",
IF({DE:Radio Type}="B","2",
IF({DE:Radio Type}="C","3",
IF({DE:Radio Type}="D","4"))))

Avatar

Correct answer by
Level 2

Thanks, this is working for me  

Avatar

Level 2

Hi,

 

I am trying this but I can't get it to work for more that one field:

 

IF({DE:Subject Area}="67813c5d0003fc7c694bb98d39de5ab5","Health: Caregiving")

 

That works but if I try to add more like the below it tells me that the expression is invalid:

 

IF({DE:Subject Area}="67813c5d0003fc7c694bb98d39de5ab5","Health: Caregiving")

IF({DE:Subject Area}="67813ba70003985be52dffadf69487dd","Health: Brain Health")

 

Any ideas on what I am doing wrong?

 

Thanks!

 

Robin

 

 

Avatar

Level 2

Just to note the exact error I am getting is: ")" is not valid in this expression

 

I get this error if I try to add anything else after the initial expression.