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

Override automatic sorting on group 2

Status
Not open for further replies.

BettyJ

Programmer
Jul 25, 2012
269
0
0
US
I have a report which has to be grouped by Patient ID. But I want the report to be sorted by Patient Name. Without programming(formulas) can this be achieved. ie. I need to override the automatic sorting on Patient ID and have the report sorted on Patient Name. Can anyone give suggestions. Thank you
 
Wouldn't you accomplish the same thing by grouping on Patient Name, but replace on the report the Group Name with the ID?
 
Grouping by patient name is risky as you can have two patients with same name but not ID

Add another group by Patient name and move it to group 1 position. Suppress the group headers and footers, this will force a patient name sort over the patient IDs

Ian
 
Thank you Ian. So you mean Group 1 should be Patient Name and Group 2 should be Patient ID. If there are formulas to get unique patient values, should those be placed in GF2?
 
Adding a new group will not affect formulas in your PatientId group. It will simply become group2, any formuale in PatientId group will automatically move too.

Just add new group it will appear as group 2, simply click and hold group and drag it up. It will then become grp1

Ian
 
Ian, I currently have Group 1 Patient Name & Group 2 Patient ID as you suggested. I have a formula that calculate latest Blood Pressure of patients.I am assigning BP to a variable.
Details
Name BP Date Blood Pressure(Systolic)
XXXX 11/11/2011 75
xxxx 1/3/2012 78
xxxx 2/17/2012 72
The rows are sorted by BP Date(ascending).
My question is to display unique patient values (eg. BP) should the formulas be placed in GF2?
 
Yes I would keep them with The PatientID group. Otherwise if you have two patients called John Smith their data will be combined in the Patient Name Group. By having PatientId as group2 you will see two records for John Smith.

Ian
 
Thankyou so much, Ian.Now it is clear.

Earlier, I tried with Patient Name as Group 1 & Date Of Birth as Group 2. But if both patients (John Smith) have same DOB, I would not get both patients' results. Since PID is always unique,there won't be such a problem. And placing name as Group I will give the report sorted by name.
 
Whenever I do reports by name I create a formula that is {name}&" "&{patientid} and use that to group/sort on.
 
You can either use Charliy's method or after grouping on Patient ID, insert a maximum on the patient name at the Patient ID level. Then go to report->group sort and select maximum of Patient name as the sort field for the group.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top