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!

Exporting at group level to csv 1

Status
Not open for further replies.

cathyg18

MIS
Mar 12, 2001
54
0
0
US
Hi guys,

Using Crystal 2016. I have a scheduled report that I need to export to a csv format. I'm working with patients and appointment times. There are times when a patient has more than one appointment on the same day. I created a group on patient account number, and am sorting that group by appointment time with earliest appointment on top. I've suppressed the detail line, and am showing all the appointment info on the group header. Viewing in Crystal shows me exactly what I want. Exporting to csv shows a line for each appointment the patient may have that day, with the earliest time on each line. The scheduler I am working with doesn't give me options to isolate report/page sections, and isolate group sections, which would give me exactly what I want - headers appearing once at the top of the page, and patients appearing in only one row, showing the earliest appointment time. Is there another solution to this?

Thanks in advance.

Cathy
 
Two things you could try (I couldn't test this):

Eliminate the suppression and use group selection instead (report->selection formula->GROUP):

{table.appt}=minimum({table.appt},{table.person})

This assumes you have limited data to a particular date and then grouped on person.

If that doesn't work for the export, create a SQL expression that returns the minimum appointment {%minappt}:

(
Select min(a.`appt`)
From table a
Where a.`person`=table.`person`
)

The punctuation depends upon your data source. Whether to include or exclude the 'a' within the min function (only) depends upon your Crystal version.

Then in report->selection formula->record, add:

{table.appt}={%minappt}

This should work, because the other appointments will not even be in the dataset for the report.

-LB
 
Thanks LB. I'll give that a try a bit later on today. I appreciate your help.
 
Doing a group selection worked perfectly. Thanks for your help.

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top