Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate blank field with data.

Status
Not open for further replies.

BigDaddyE

MIS
Apr 29, 2010
27
US
//This is my formula that works unless
//the {ep_discipline.dc_reason_code} = "" then
//nothing displays. Should I populate the blank
//with bogus data or is their a way around this?
//If I should populate with bogus data then how?
//So if {ep_discipline.dc_reason_code} = "" and
//{substation.sub_code} = "84" then nothing appears when
//it should.


(({ep_discipline.dc_reason_code} = ["37", "20"])
or
(({substation.sub_code} in ["84", "85", "87", "88"])
 
It sounds more like you the field is null. Try this instead:

(
isnull({ep_discipline.dc_reason_code}) and
{substation.sub_code} in ["84", "85", "87", "88"]
) or
{ep_discipline.dc_reason_code} = ["37", "20"] or
{substation.sub_code} in ["84", "85", "87", "88"]

-LB
 
Nope. Sorry I attempted to simplify the code, it actually looks at the previous {ep_discipline.dc_reason_code} which will always be 37 or 20. But if the person is still active they have a blank {ep_discipline.dc_reason_code}. So when the current {ep_discipline.dc_reason_code} is blank it can not look at the current code so it asumes that a previous does not exist. SO I need to populate the {ep_discipline.dc_reason_code} with something so it can check the previouse {ep_discipline.dc_reason_code}.

//**************************
If
((
(not onlastrecord) and
({patient.med_rec_num} = next({patient.med_rec_num})) and
({ep_discipline.dc_reason_code} = ["37", "20"]) and
(["84", "85", "87"]= next({substation.sub_code}))
)

or

(
(not onfirstrecord) and
({patient.med_rec_num} = previous({patient.med_rec_num})) and
({substation.sub_code} = ["84", "85", "87"]) and
(["37", "20"] = previous({ep_discipline.dc_reason_code}))
))

Then TRUE
 
I don't believe it is blank. Try going to file->report options->and check "convert nulls to default values" and see if that gives you the desired results.

You are overdoing the parens. They should be used to set off the 'or' statements, but are otherwise unnecessary to set off other clauses.

-LB
 
Sorry about the paren, they make it easier for me to see what is happening. The fields are blank because {ep_discipline.dc_reason_code} stands for episode discharge reason code. the specific patients that are missing from my data are still active patients. A patient is active until they get a discharge reason code. So the field is actually null so I just need to figure out how to populate the null fields with XXX so they will berecognized as a record so the previous command will work.
 
Please try my suggestion which makes the field not null.

-LB
 
Please explain how you are using this formula (where you are putting it and what it is intended to do) and also provide some sample data.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top