Alisun Posted March 30, 2006 Posted March 30, 2006 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
Reed Posted March 30, 2006 Posted March 30, 2006 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.
Fitch Posted March 30, 2006 Posted March 30, 2006 Another fun calc to use would be the ever-neglected Choose function: Choose( yourField ; "" ; "YES" ; "NO" ; "MISSING" )
Genx Posted March 31, 2006 Posted March 31, 2006 ;) choose is dodgey but is the syntax: Choose(NumberField; Value if NumberField = 0; Value if NumberField = 1...etc.)?
LaRetta Posted March 31, 2006 Posted March 31, 2006 (edited) 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, 2006 by Guest
Genx Posted March 31, 2006 Posted March 31, 2006 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
Alisun Posted May 1, 2006 Author Posted May 1, 2006 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
Fitch Posted May 1, 2006 Posted May 1, 2006 "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"?
Alisun Posted May 1, 2006 Author Posted May 1, 2006 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
Recommended Posts
This topic is 6783 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now