Using "if" statement with scores to determine final score | XM Community
Question

Using "if" statement with scores to determine final score

  • 6 May 2021
  • 1 reply
  • 38 views

Badge +1

I have a module within our survey that assesses respondents' experience of food insecurity based on a psychometrically reliable and validated measure. The module has a possible range of scores from 0 to 6; however, the score is set to "NS" (not scored) if respondents decline to answer more than 2 of the questions. If the number of "prefer to not answer" responses are 2 or less than the score is the total of the responses. I am thinking that this would be accomplished within javascript (although I am lower than a novice in using javascript). I am looking to this community for ideas.
My thought is that I would create an embedded data field called FIScore in survey flow. Scores would be collected within the Scoring capability of Qualtrics for 1) the total number of affirmative responses (FStotal) and 2) the total number of declined responses (NRtotal). The javascript would use pipedtext to use the scores within the javascript. The logic would be: if (NRtotal>2) FIScore = "NS" else FIScore = FStotal. Does that approach make sense? Am I missing a more simple solution? Thank you in advance!


1 reply

Userlevel 7
Badge +21

Set the values of prefer not to answer to either extremely high like 10000 or extremely low like -10000.
After the questions, create a branch to set the value of FIScore to "NS" if FIScore is greater than 20,000 or less than zero.

Leave a Reply