Jump to content

Recoding


This topic is 5700 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Another fun calc to use would be the ever-neglected Choose function:

Choose( yourField ; "" ; "YES" ; "NO" ; "MISSING" )

Link to comment
Share on other sites

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. :giggle:

L

Edited by Guest
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

"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"?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 5700 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.