The first is easy to understand. Of course will it overwrite.
Maybe you may save it by:
{GenderDummy1=if(genderid=="male" or gender==1,"1")}
{GenderDummy1=if(genderid=="female" or gender==2 ,"2", GenderDummy1)}
You should try.
But better:
{GenderDummy1=if(genderid=="male" or gender==1,1,2)}
if there is no other option. If it is not 1 then it is 2.
Otherwise (there is a third option) you should use a nested IF with the usual syntax {IF(condition,what if true, what if false)}
{GenderDummy1=if(genderid=="male" or gender==1,1,if(genderid=="female" or gender==2 ,2,0))}
Here you see that the FALSE part of the first IF is a new IF-statement.
The result will be:
1, if genderid == "male"
1, if gender == 1
2, if genderid == "female"
2, if gender == 2
0, if genderid != "male" and gender!=1 and genderid!="female" and gender!=2
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.