Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Returning text based on a calculated score

Avatar

Level 1

I am a beginner with LiveCycle calculations.  I have created a questionnaire that calculates a score based on the answers a user chooses from drop downs. 

I now need to figure out how to populate a field with text based on the score range.  For example, of the calculated score for the questionnaire is between 8 and 10, then I want to have a field captioned "Risk Assessment" that would populate with the text "High".  If the calculated score added up to between 5 and 7, then the "Risk Assessment field should populate with the text "Moderate". etc.

I have been trying to figure this out using if/then, but so far have had no luck. This is what I have so far-- my two fields are named "Score" and "Risk".

 

if (Score.rawValue >=8)then (Risk) == "High" endif

Any assistance would be greatly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

One way would be to use the Choose function in the calculate event if the Risk field, so something like;

//              1      2      3      4         5           6           7        8       9       10

Choose(Score, "Low", "Low", "Low", "Low", "Moderate", "Moderate", "Moderate", "High", "High", "High")

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

One way would be to use the Choose function in the calculate event if the Risk field, so something like;

//              1      2      3      4         5           6           7        8       9       10

Choose(Score, "Low", "Low", "Low", "Low", "Moderate", "Moderate", "Moderate", "High", "High", "High")

Regards

Bruce

Avatar

Level 1

Bruce--

You are a brilliant man!  Thank you so much-- it is working perfectly!   Thank you so much.

-Jamie