 # Pop up next question based the integer

(Giri) #1

I have multi select Integer question in the first.

I would like to get an other question if there is value entered in one of the question.

for ex: what is your income? - "\$2500"

if the value is entered, then
how much will be your monthly expenses?

Please help me to solve the same in XLs form.

thanks

(Yaw Anokwa) #2

See https://docs.opendatakit.org/form-logic/#conditionally-showing-questions. http://xlsform.org/en/#relevant might also be helpful.

(Giri) #3

Hey hi:) thank you so much for the time..

But I do have an other logic to be worked.

Logic 1:
If I give a number (decimal) for a question a sub question should be popped. (Note: I am not selecting the question, but I am entering a value for that)

Logic 2:
I have 3 decimal type questions under one group. The sum of all the three should not exceed \$100. (this is for our calculation)
-Income of person 1
-Income of person 2
-Income of person 3

Kindly help me to sort these. thank you

(ARIF AZAD KHAN) #4

See this xls relevant_based_on_integer.xlsx (14.7 KB)

(Giri) #5

Thanks it helps

(Giri) #6

Hi thank you:) would like to know if the below addition could be added to this.

can this logic could be included?
if Q1. is 30
Q2. is 30
Q3 0
Q4 40 (of hundred can I get this automatically fill based on the previous calculation?)

Thanks

(ARIF AZAD KHAN) #7

Read this section and i hope you will get your answer:
https://docs.opendatakit.org/form-operators-functions/#math-operators

(Dr. Gareth S. Bestor) #8

Although it may seem obvious, the precise problem is somewhat under-defined (and open to interpretation, which affects the solution): eg

• less than 100, or less than or equal to?
• can income be negative? (presumably not, but because we're having to define the calculation using integers, there's no harm in specifying these must be whole numbers. This is easy to forget...)
• are all the questions mandatory, relevant on each other, or can they be answered in any order, etc. For example, if the user answers 100 for income1, do you want to even bother showing the other two?

When you are dealing with multiple questions with mutual-dependence on each other, you need to frame the problem rather carefully, especially the order in which they must be answered (if any).