Need help: combining two conditions not working

Hi everyone,

In the following image, we have questions 1312 (multichoice question) and 1313 (checkbox). I have built a condition to show question 1314 only if 1312 is Sim or 1313 has not selected NAO SEI, but it is not working.

Display condition

Looking forward to help

Thanks

It looks like the logic you have might just be backwards from what you are describing. The current condition will only display the question if 1312 = SIM or 1313 != NAO SEI

Hi @Clayton_Sims,

Then what would the expression look like to achieve the desired result?

What I want is if 1312 is SIM and 1313 is any choice except (NAO SEI), display 1314.

Thanks

I think the right logic then would be

Q1312 = '1' and NOT(selected(Q1313, '98'))

rather than OR not selected

Hi @Clayton_Sims;

The following expression works

But another issue has risen regarding another question:

I want to show question 104A if options Primário (Ep1) or primário (Ep2) or
Ensino secundário (1ºCiclo) or Ensino secundário (2º Ciclo) is selected in 104. The expression in the image below does not work

02, 03, 04 and 05 are the option codes

Thanks

My guess is that there might be some type coercion going on which is (or isn't) turning options from strings to numbers. You have leading '0's on the choice strings ('04' instead of '4'), and it's possible the input is (explicitly or implicitly) being represented as a number.

If the leading '0' isn't important to your internal logic, my suggestion would be to make comparisons to numeric outputs with no quotes (IE: #form/Q104 = 4, rather than #form/Q104 = '04') since I think that will be the most robust / resilient against other type changes.

hi @Clayton_Sims,

I removed the leading zeros and made the comparisons with and without quotes but it is still not working.


Thanks

What is the literal value in Q104 when you look at the Raw XML in the data preview tool?