'If' statement help
Hi,
I am trying to use a calculation field to give a Low, Medium or High category to a risk score.
I am new to Javascript so have tried to come up with something based on some of the suggestions on here previously, and ended up with:
var Inherent_Rating_Category;
if(@Inherent_Rating_Score == "1""2""3""4""5""6"){Inherent_Rating_Category = "Low"}
if(@Inherent_Rating_Score == "7""8"9"10""11""12""13""14""15"){Inherent_Rating_Category = "Medium"}
if(@Inherent_Rating_Score == "16""17""18""19""20""21""22""23""24""25"){Inherent_Rating_Category = "High"}
Podio tells me the calculation field must reference at least one other field...can anyone help me sort this out?
Many thanks,
Hannah
-
Hi Hannah,
as Nate wrote, the field `@Inherent_Rating_Score ' must be highlighted blue (enter @inherent and select the field from the dropdown list).
Besides that: I think your code wouldn't work for several reasons: You can try this one:var IRS = @Inherent_Rating_Score; var Inherent_Rating_Category = IRS < 7 ? "Low" : IRS < 16 ? "Medium" : "High" Inherent_Rating_Category
Rainer
Please sign in to leave a comment.
Comments
3 comments