Hi all, I have a dataset with column headings as follows: account number | var1 | val1 | var2 | val2 | var3 | val3 | var4 | val4 | var5 | val5 | var6 | val6 | this is what I would like to do: if var1 = 1 then balance = val1; if var2 = 1 then balance = val2; if var3 = 1 then balance = val3; ... if var6 = 1 then balance = val6; However, for some account numbers, multiple vars are equal to one. I might have this situation: account number | var1 | val1 | var2 | val2 | var3 | val3 | var4 | val4 | var5 | val5 | var6 | val6 | 123456 | 1 | 512 | 1 | 625 | | | | | | | | | In this case, I would like to take make 'balance' equal to the highest 'val' there is. So as var1 and var2 are both equal to 1, I would like balance to equal the highest value of the relative vals. In this case, 625. Any ideas? thanks in advance, Marco
... View more