Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping Records Post Reply Post New Topic
Author Message
George55
Newbie
Newbie


Joined: 05 May 2014
Location: Australia
Online Status: Offline
Posts: 3
Quote George55 Replybullet Topic: Grouping Records
     Posted: 06 May 2014 at 1:02pm
Hi
I'm new to Crystal Reports and would be grateful of some assistance. I have a report which consists of one table. The report is a list of customers with transactions posted to their accounts the previous day. Each transaction is identified by a Trancode. My report has to detail all those customers who had  a combination of both a Trancode 61 & 6J. To clarify, I only want those customers who had both Trancodes. If they had one or the other they would not appear on the report.
Using the Select Expert I get this formula:
{AccTran.TransProcessDate} = DateTime (2014, 05, 02, 00, 00, 00) and
{AccTran.TransCode} in ["6J", "61"]
However when I Group this under the customer it produces a report for every customer who had either one of the Trancodes not both.
Thanks

George
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 May 2014 at 4:08am
You will have to use a group condition to find records that meet both conditions.
Group on the client
Create 2 'flag' formula to look fo reach condition
//flag6J
if {AccTran.TransCode} ="6J" then 1
//flag61
if {AccTran.TransCode} ="61" then 1
sum each at the client group level
sum(flag6J,client)
sum(flag61,client) 
 
now you can use a group select to look of rlcients that meet both conditions
sum(flag6J,client)>0 and sum(flag61,client)>0
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 May 2014 at 4:20am

Also note that the use of the "{AccTran.TransCode} in ["6J", "61"]" criteria in the record select will limit the returned values for the client ot only show those two records. If you want to see all activity for the client on that day remvoe that criteria from the record select.

IP IP Logged
George55
Newbie
Newbie


Joined: 05 May 2014
Location: Australia
Online Status: Offline
Posts: 3
Quote George55 Replybullet Posted: 07 May 2014 at 1:30pm
Thanks
I managed to do everything up to the Group Select. when I try to insert the formula - sum(flag6J,client)>0 and sum(flag61,client)>0, I get an error message "The ) is missing" and it highlights the spot immediately after flag6J above
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 May 2014 at 3:58am
Those were just examples as I don't know your data fields
it will be more like


Edited by DBlank - 08 May 2014 at 4:01am
IP IP Logged
George55
Newbie
Newbie


Joined: 05 May 2014
Location: Australia
Online Status: Offline
Posts: 3
Quote George55 Replybullet Posted: 08 May 2014 at 1:48pm
Thanks for your help once again.
That worked perfectly.

George
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