Multiplication of a piped in text results in 0 under certain percantage | XM Community
Skip to main content

Hello!
I am trying to create a question, that multiplies one of the earlier answers in a survey, and shows a small portion of it. All would work fine, except for the fact that any multiplication below *0.05 results in the amount being 0 for amounts that are too low (e.g. it works just fine when the input is 10000, but throws a 0 when it is 5000 or 1000). Does anybody know why that happens? Is it maybe some issue with the decimals?
All help is appreciated!

mpyrkowski
Are you using qualtrics Math operations or ext JS to make calculations ?
If Qualtrics Math Operations, do not include round in the equation.

Hope this helps!


@Deepak I am actually using the built in Qualtrics, but the numbers should be whole (as in 2.5% of 1000 is already equal to zero when I display the question, but 5% is just fine).


mpyrkowski
I did try it and I am getting the result correctly. It seems there is an issue in the way you have formed the equation. I added this in embedded data and displayed it came up just fine. Check for spaces in your equation.
$e{ 0.5 * 1000 }
Hope this helps!


Deepak my problem is that the number I want to multiply is not coming from embedded, but rather from a text field that the participant fills with a number. This results in my code being $e{q://QID164/ChoiceTextEntryValue * 0.025}. As I said, this syntax works perfectly good for certain numbers, but some just toss 0 at me, which is just bizzare.


mpyrkowski
That should not be an issue until and unless it's a numeric value. I would recommend to add a content type validation of number on the text entry. The ones which toss "0" would you mind posting what the user had entered if it was a string value Qualtrics returns "0" on it even if the equation you formed is correct.
Hope this helps!


Deepak the value which tosses 0 is, as far as my tests go (the survey is not yet published to a wider public) it is just that smaller numbers toss the error. From my tests they were 1000, 2500 but when you put in 3000 it calculates it perfectly fine.


mpyrkowski
Try including the below expression and check. As I was able to get the desired result from values 1000,2500,3000. Your expression misses some spaces.
$e{ ( q://QID164/ChoiceTextEntryValue ) * 0.025 }
Hope this helps!


Leave a Reply