Math operation with response and random number returning "Invalid Expression" | XM Community
Skip to main content

I have defined an ebedded data random number at the beginning of the survey flow as:

After the questions block, I use the following code to generate a value that is equal to their  numeric answer at QID28 + a random share of this value:

$e{ q://QID28/SelectedChoicesRecode + ((e://Field/Random_Number / 100) * q://QID28/SelectedChoicesRecode) }

But I get ‘Inavlid expression’. What am I doing wrong? 

Many thanks

Update: The issue is that you have to put spaces between every math operator. The correct expression is:
 

$e{ q://QID28/SelectedChoicesRecode + ( ( e://Field/Random_Number / 100 ) * q://QID28/SelectedChoicesRecode ) }


Leave a Reply