Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record Selection Problems Post Reply Post New Topic
Author Message
JFinzel
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Location: United States
Online Status: Offline
Posts: 49
Quote JFinzel Replybullet Topic: Record Selection Problems
     Posted: 09 Jan 2012 at 7:21am
I have a recurring problem: Say I have a set of data like so:
Record 1
- Table A - Event 1 - attended
                 Event 2 - not attended
                 Event 3 - attended
Record 2
- Table A - Event 1 - not attended
                 Event 2 - not attended
                 Event 3 - attended
etc....

Of my data set, I want to select only those people who attended event 1.  However, I want to show ALL data for Events 1-3.  When I do a record selection or a group selection for condition (Event ID = 1 and Event 1 = Attended), I only ever see Event 1 information.

Thus, the data looks like so, in "Details:"

Record 1      Event 1     Attended

I want it to look like this:

Record 1      Event 1     Attended
Record 1      Event 2     Not Attended
Record 1      Event 3     Attended

I know this is because it is selecting only Event 1.  But I want that as an inclusive condition, to include ALL the records for "Record 1", not only Event 1 info.

The only way I know how to show the information I want is through subreports, linking the records, and making a whole new report for Events 1-3 that matches my record selection in the main report.  Can anyone tell me if this problem can be solved?

Thank you!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jan 2012 at 7:34am
if i understand your question...
outside of crystal (or in a Command) you can create a join with an additional join clause to limit the data or an sub query in the main query with a join to limit the data set.
Inside of crystal you can use grouping and group level select criteria.
Group on Person field
create a 'flag' formula
if field1="event 1-Attendeded' then 1
sum this at the group level
sum(@flag,table.person)
In the select expert, change the select toggel option to 'group selection' and add your condition
sum(@flag,table.person)>0
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum