embedded data math operations | XM Community
Skip to main content

Nope, I just spelled something wrong. But if anyone is searching for help with math in the future…

 

THIS WORKS
Addition

$e{q://1_QID11%231/ChoiceTextEntryValue/1/1 + q://1_QID11%231/ChoiceTextEntryValue/2/1}

Multiplication
$e{q://1_QID11%231/ChoiceTextEntryValue/1/1 * 2}

Multiplication + Addition

$e{
(
q://1_QID11%231/ChoiceTextEntryValue/1/1 *10
+
q://1_QID11%231/ChoiceTextEntryValue/2/1 * 6
+
q://1_QID11%231/ChoiceTextEntryValue/3/1
+
q://1_QID11%231/ChoiceTextEntryValue/4/1
) * 30}

Making it more complex:
The multiplication + addition I need.The goal is, if the numbers entered in the question are are 2, 3, 4, and 1:

 $30 * (2 + 3  + 4 + 1 ) And then we add to that
+ 2 * 2
+ 3 * 2
+ 4 * 1

 

THIS WORKS
$e{
(( q://1_QID11%231/ChoiceTextEntryValue/1/1
 +
q://1_QID11%231/ChoiceTextEntryValue/2/1
 +
 q://1_QID11%231/ChoiceTextEntryValue/3/1
 +
 q://1_QID11%231/ChoiceTextEntryValue/4/1
 ) * 30 )
 +
( q://1_QID11%231/ChoiceTextEntryValue/1/1 * 2
 +
 q://1_QID11%231/ChoiceTextEntryValue/2/1 * 2
 +
 q://1_QID11%231/ChoiceTextEntryValue/3/1 )
}

Be the first to reply!

Leave a Reply