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

Grouping

Status
Not open for further replies.

kinvie

Technical User
Aug 4, 2004
21
US
I am using Crystal 10.0 connecting to a view that has already been set up with the tables linked. I am unable to get to the tables to do different linking or use a command. Currently I am using a select statement and I get results that look like this

Patient # Name Diag 1 Diag 2 Diag 3 Diag 4
12345 John Smith 162.3 198.5 196.0
12345 John Smith 162.9
12345 John Smith 162.3 198.5 196.0
12345 John Smith 162.9

I would also have additional patients with various lines of data and repeating diagnosis. What I would like to display is this:

Patient # Name Diag 1 Diag 2 Diag 3 Diag 4
12345 John Smith 162.3 162.9 198.5 196.0

The order of the diagnosis codes do not matter I just don't want then to report in different rows. If anyone has any idea's I would really appreciate it.

Thanks

 
Thanks but this wont work for me because I may have three different results under Diag 1. A max would eliminate the other two from the list. THanks for the try though....
 
If you don't care what column (diag1, diag2, etc.) that these fit under, then you could use a formula like this in the detail section (assuming the codes are strings):

whileprintingrecords;
stringvar x;
if instr(x,{table.diag1}) = 0 then
x := x + {table.diag1} + " ";
if instr(x,{table.diag2}) = 0 then
x := x + {table.diag2} + " ";
if instr(x,{table.diag3}) = 0 then
x := x + {table.diag3} + " ";
if instr(x,{table.diag4}) = 0 then
x := x + {table.diag4} + " ";

In the group header (based on client), use a formula like this:

whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

In the group footer, add this formula:\
whileprintingrecords;
stringvar x;
trim(x)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top