String variable: name of household from a list or from another question if individual not in the household

I have a household survey, in which the first thing I do is create a list of household members. There is a section on maternity in which we ask questions only for women with kids born in the last 12 months. The first question in that section is to identify the name of kid using the pre-defined list of household members [LETS CALL THIS VARIABLE Q1]. However, it may happen that the kid is not living in the household, in that case we ask the name of the kid [LETS CALL THIS VARIABLE Q2]
For the rest of this section we ask a lot of questions about the newborn kid and we want to use the kid’s name. What I need to create is a string variable that takes value Q2 if Q2 is answered and Q1 if Q2 is missing.
I do not manage to do this, could anyone provide some tip on how to create such a variable?

Teresa, I am not sure how you are going to use that variable, but if you want to ask Q3 about that person, why not simply include %Q1%%Q2% into the text of the question? Only one of the two will be filled out so you will have a good substitution.

Best, Sergiy

Thanks Sergiy, it is what I ended doing, I thought that there could be a nicer way to do it.
All the best,