Can we generate two distinct names for one question?

Hi dears,
Is it possible to generate two distinct names for the same question within ODK? For example, I have a form to collect data at a household level and each household has to respond to 20 questions and each question is named as Q1, Q2...Q20. But I would like to have an additional variable (question) name for the same question, e.g., AGE, SEX..
I can do that outside ODK after downloading the data using other programs but I want to make it as part of the ODK program if it is possible.
Thank you
E

1. What is the issue? Please be detailed.

2. What steps can we take to reproduce this issue?

3. What have you tried to fix the issue?

4. Upload any test forms or screenshots below.

1 Like

One option would be to have a second question for each question that is a calculate type that copies the answer from the previous one.

+-----------+------+-------------+-------------+
|   type    | name |    label    | calculation |
+-----------+------+-------------+-------------+
| integer   | Q1   | Age (years) |             |
| calculate | AGE  |             | ${Q1}       |
+-----------+------+-------------+-------------+

You could combine both values into one field.

+---------+--------+-------------+
|  type   |  name  |    label    |
+---------+--------+-------------+
| integer | Q1_AGE | Age (years) |
+---------+--------+-------------+

What is the reason you want the two variable names for the same response?

1 Like

It is not possible to assign multiple identifiers to the same datum in the actual resulting XForms instance element, without actually duplicating the value. Which is basically @danbjoseph first - and probably recommend - solution.

Thank you very much! The Q1.. label is required for training purpose because the numerical order is intuitive for trainees when explaining skips etc but the standard label (AGE) is preferred for the data analysis codes. The main challenge is that the survey is conducted in several countries and each country may have different questions for similar labels (e.g., Q3 could be sex for country A while it could be age for country y) so it will be difficult to adopt template analysis codes for different countries if the Q1 label is used. I hope it makes sense
Thank you
E

1 Like

You may want to extend @danbjoseph and @Xiphware's proposed solution with a conditional calculation. For example, using if you could only populate AGE if you know Q1 represents age. Something like if(${country}='countrya' or ${country}='countryb', ${Q1}, '').

You can nest ifs as well: if(${country}='countrya' or ${country}='countryb', ${Q1}, if(${country}='countryc', ${Q7}, '')) This would populate AGE with the value for Q1 for countries a or b. It would populate AGE with the value for Q7 for country c.