March 30, 200619 yr Does anyone know how to recode? For example, I have a database of approximately 500 patients, and I have imported info. from a doctor, written as "1" "2" and "3". These numbers need to be translated into English. How do I change: 1 to YES 2 to NO 3 to MISSING Any help would be greatly appreciated. Thank you, Alisun
March 30, 200619 yr Do a calculated replace field contents... Case ( field="1"; "YES"; field="2";"NO"; field="3";"MISSING" ) The replace field contents command is in the records menu. If you want to do this more than once, you can create a script that uses an equivalent script step.
March 30, 200619 yr Another fun calc to use would be the ever-neglected Choose function: Choose( yourField ; "" ; "YES" ; "NO" ; "MISSING" )
March 31, 200619 yr ;) choose is dodgey but is the syntax: Choose(NumberField; Value if NumberField = 0; Value if NumberField = 1...etc.)?
March 31, 200619 yr Yes Genx, that is how Choose() equates. choose is dodgey Dear boy ... Choose() is one of the most powerful, efficient functions we have!!! You wanna see speed-test comparisons vs. our beloved Case() and If()? It blows them out of the water! Don't bad-mouth a woman you've never been with. Once you get into bed with Choose(), you will bow (appropriately) at her feet... update ... emmm, or HIS feet. L Edited March 31, 200619 yr by Guest
March 31, 200619 yr Hehehe, ... yeah, i really should start paying attention to speed, but as of yet, i've had no real reason, my databases don't extend past 25,000 records, so it's not amazingly detrimental an issue for me.. But, point taken, i'll never love another non-gender specific function eh? ~Genx
May 1, 200619 yr Author HELP!!! I did the calculated replace that Reed suggested, and now all my data is MISSING from that field! Here's what I did: Case ( field="1"; "YES"; field="2";"NO"; field="3";"MISSING" ) How can I get my data back??? Alisun
May 1, 200619 yr "Permanently replace the contents..." is what the dialog says, and that's what it does. There is no undo. We should have warned you, always back up your file before using the Replace command. Are you sure the data is gone? Make sure the field is defined as a TEXT field, it may have been previously defined as a Number field. Also, in the suggested calculation, "field" should have been taken to mean the actual name of the field in question, not the literal word "field." But you must have used an actual field name or it wouldn't have accepted the calculation. You really have a field named "field"?
May 1, 200619 yr Author The data in my field (the actual field name is 'Diagnosis') has been "permanently replaced" with nothing. Thank goodness it is just that one field, and more importantly - thank goodness I backup my database every time it is updated, so I still have a good copy. This is a very clear lesson on the importance of backing up data! I'm going to make another copy of my database, and retry the 'calcuated replace field contents' on the copy. Thanks for "being here" for me : Alisun
Create an account or sign in to comment