Default choice display option using piped text (subtraction of options) | XM Community
Skip to main content
Hi all!

In my questionnaire, I have two items in the following order:

1. How many children do you have in your class:

[text entry]

2. An item with the following response scale (Constant Sum type):

[respondent types in a number] Never

[respondent types in a number] Sometimes

[respondent types in a number] Always



In the 'Sometimes' option I want to have a number displayed that takes the value from questions 1 (for instance 10 children) which is subtracted by the number entered in the 'never' and 'always' option (for instance, respondent enters 1 in 'Never', 2 in 'Always' and given they entered 10 in the first question, 'Sometimes' option should display 7). Having read some Qualtrics guidelines, I came up with this equation, which doesn't work when I use 'Add Default Choices' and then pipped text option for 'Sometimes': $e{ q://QID2/ChoiceTextEntryValue - q://QID3/ChoiceNumericEntryValue/1 }



Could someone please advise me how can this be achieved?



Best wishes

Nora
Default choices are set when the page loads, they aren't dynamic. Also, pipes (and math operations) aren't dynamic, they are replaced/calculated on the server before the page is sent to the browser.



So, if you want to calculate a number using other numbers on the same page, you have to do it with JavaScript.

Leave a Reply