Hi everyone, I would like to create new dummy variables (LOCAL & INTL) from 2 string values taken from variables ORIGIN and TARGET.
Below is an example:
So, what line of code should I use to create something like:
Local = 1 if ORIGIN = TARGET (INTL = 0)
INTL = 1 if ORGIN =/= TARGET (LOCAL = 0)
(the contry codes listed are only an example)
I hope that makes sense. Thank you!
-KH
Below is an example:
ORIGIN | TARGET | LOCAL | INTL |
US | US | 1 | 0 |
NL | CH | 0 | 1 |
GB | TH | 0 | 1 |
CH | CH | 1 | 0 |
IN | BR | 0 | 1 |
Local = 1 if ORIGIN = TARGET (INTL = 0)
INTL = 1 if ORGIN =/= TARGET (LOCAL = 0)
(the contry codes listed are only an example)
I hope that makes sense. Thank you!
-KH
Comment