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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GroupBy field null

Status
Not open for further replies.

5lights

MIS
Nov 19, 2003
53
US
Patients are grouped by Impairment(in my case "mentally").
Impairment is in table with 3 records/patient(one for each Assessment type).
The third Assessment type always leaves the Impairment blank.
How can I include the third Assessment in Group along with the rest of its assoc patient records?
Is there a formula, that during Grouping will pull the "Impairment" from other record for same patient?
 
The other 2 of the 3 records are the same?

WHat you are asking is not to group them together since that goes against the definition of grouping, what you're after is to alter the data for the 3rd row, or what sounds simpler to me, is to simply group by the patient themselves.

If the concern is that they have more than 1 of the sets of 3 impairments, perhaps a date would be the reasonable way to uniquely identify them.

3 records per impairment sounds very inefficient, I suspect that there's a good deal of discovery left to unfurl.

-k
 
OK,
I need the report to show one record for each patient grouped by Impairment, yet include scores from each of the three Assessments(duplicated patient records).
Ref my Post: "Paradox table & Field grouping" (posted Friday in the OtherTopics thread)
I've got data from two records working by a Next() statement & supressing the duplicate patient row...now I need to get the third record into the Group so I can do the same(pull data via a Next(Next()) statement.......
Or is there a better way to merge data from 'duplicate record/same field' without the benefit of subreports(already sub'd) or SQL/ODBC views?
I really am making this as difficult as possible, aren't I?
 
I'm not sure I follow, but if you want to get a value like 'Imparement' from several different sources, and then group on it, the best solution is to create a formula field that checks each in turn, uses the value when it can and otherwise says something like 'Other' or 'Not Specified'. e.g.

If not isnull {rec1.impaired}
and {rec1.impaired} <> " "
then {rec1.impaired}
else If not isnull {rec2.impaired}
and {rec2.impaired} <> " "
then {rec2.impaired}
else If not isnull {rec3.impaired}
and {rec3.impaired} <> " "
then {rec3.impaired}
else "Other".

Group using this formla field.

Madawc Williams
East Anglia, Great Britain
 
Thats what I'm looking for but I dont know how to reference a different record...IE {rec2.impaired}.
If I want it to use the value from the same table, same {patientID}, but the record that has an {Assessment code} of '1' and the data from the {Impaired} field.
 
Maybe do the logic in several formula fields, and then put them together in another formula fields that tests the various results.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top