Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Comparing a Table To Itself Post Reply Post New Topic
Author Message
jkjackson
Newbie
Newbie


Joined: 27 Jul 2011
Location: United States
Online Status: Offline
Posts: 6
Quote jkjackson Replybullet Topic: Comparing a Table To Itself
    Posted: 10 Jan 2013 at 7:21am

I need help writing a report that basically compares a table to itself. In This table each row of data contains a field for customer number, account type and account group type. Since we are a financial institution a customer can have numerous account types in this table. Here is an example:(each line represents a new row of data)

Customer Number          Account Type    Account Group Type

123456                                  1                            A

123456                                  2                             B

123456                                  3                             A

 So as you can see each account number can be listed several times in the table per account type. What I am trying to accomplish is pulling a report that shows customer numbers that don’t have a specific account type (say a 10) in the table. I can’t figure out for the life of me how to do this. My first guess is a loop or somehow using an array. Any suggestions?

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2013 at 7:44am
group select criteria
group on the client
create a "flag formula" using a if-then 1 else 0 for what you want to check on
e.g. if account type=10 then 1 else 0
now you can sum the 'flag' at the group level.
any group (person) that has the sum=0 does not have the account
that can be used in teh group select criteria as
sum(flag,client)=0
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.