Show a value or another in a note

Hello Kobotoolbox community.

I wanted to ask if it was possible to do the following:

  1. I have two calculate fields that make some simple calculations. Let’s say they are Q1 and Q2.
  2. In order to send the questionnaire, the user should select mandatory whether he/she want to calculate Q1 OR Q2 (on a previous select_one question).
  3. If the user want to calculate Q1, then it should fill the fields that make the Q1 calculation possible, if it want to calculate Q2, then it should do the same with the fields that made Q2 calculations posible.
  4. I want to display either Q1 or Q2 in another calculate field but only the one that is being calculated. I mean, if Q1 is calculated (because the fields that are required for its calculation are completed) then show me Q1, if not, show me then the other that should then be calculated (Q2). I want to show only the one that is being actually calculated. I thought about some form of coalesce but it doesn’t work, and also about the ‘trigger’ column but it seems that it doesn’t work with this kind of problems either.

Is it possible to do this?

Many thanks.

I have an example, but since i am new, i am not able to upload files.

Hello @Juan,
You might even use 2 integer fields with a calculation and read_only set to true. With relevant clause for each integer you can filter which of the calculated integer is shown.
You don’t need an extra note.

1 Like

Hello @wross Thank you for your kind reply. However i am not following you.
My XLSform looks like this:

Based on your solutions, they still show both of the calculated values, and i wanted only to show one, i want it to make it on a note because i want to show some text on it with the value.

Many thanks.

Add ${which_one}=‘q1’ in the relevant column for note_a1

Do similarly for 2nd note

1 Like