Hello.
I am attempting to create a hazard assessment form.
I have three drop-down lists, Exposure, Probability and Severity, respectively, that assign a numeric value to each of these.
Exposure can be ranked from 5 (most severe) to 1 (least severe).
Probabiliy can be ranked from 5 (most probable) to 1 (least probable).
Severity can be ranked from 10 (most severe), 5, 4, 3 and 2 (least severe).
Risk Cassification is a numeric field whose value is dynamically determined by calculating the sum of these three values. I have this as a calculate event in FormCalc, and the field is a numeric field set as Calculated - Read Only.
I would like to assign a text value to add context to the calculated value of the Risk Classification field. This is where I'm running into difficulty. I have a text field called Classification and it is set to Calculated - Read Only.
I've tried to do this using a variety of methods and events in FormCalc and also using the Action Builder. I haven't' had any luck.
Here's what I'm trying to accomplish:
Risk Classification (calculated on the fly)
| Text to display |
---|
16-20 | Extreme |
11-15 | High |
6-10 | Moderate |
3-5 | Low |
In other words, the numeric value of the calculation is displayed, and next to it, in a text field, I would also like to display the corresponding text for that rating.
I've referred to another post to come up with the following FormCalc code, invoked through a change/exit event on the Risk Classification field:
if (16 le $.rawValue le 20) then
Classification = "Extreme";
elseif (11 le $.rawValue le 15) then
Classification = "High";
elseif (6 le $.rawValue le 10) then
Classification = "Moderate";
elseif (3 le $.rawValue le 5) then
Classification = "Low";
else
Classification = null;
endif
As I say, to this point, this code does not work.