Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Filtering Post Reply Post New Topic
Page  of 2 Next >>
Author Message
HEMREDDY
Newbie
Newbie


Joined: 31 Jul 2013
Online Status: Offline
Posts: 38
Quote HEMREDDY Replybullet Topic: Filtering
     Posted: 06 Dec 2013 at 5:26am
Hi,
 
I have two tables as below.
 
Customer Sales (Table 1)
 
Acct #  Item #   Order #     Qty Sold
1         x1          452             1
1         x3           453             1
2          x1          455              1
 
Top 20% of Items Sold (based on sales) (table 2)
 
Item No      Description
X4              Cloth            
x1               spoons
I need to get a list of cutomers who have not bought any one of the listed items in Table 2 and display the same agaist the customer name.  I will be linking the tables 1 and 2 throgh a left outer join on item Number in both the tables.
 
In the above exapmle i want to display the folloiwng
 acct #      Item no     Description
  1             X4             CLOTH
  2             X4             CLOTH
Any help would be appreciated.
 
Hem Reddy
 
 
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 06 Dec 2013 at 5:33am
the link would be
table2 left outer table1
in select expert
isnull(table1.item_no )
IP IP Logged
HEMREDDY
Newbie
Newbie


Joined: 31 Jul 2013
Online Status: Offline
Posts: 38
Quote HEMREDDY Replybullet Posted: 06 Dec 2013 at 6:34am

Hi

This is not working. The report doies not return any values
 
Hem Reddy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Dec 2013 at 6:43am
make sure you place the item_no field from table 2 onto the report canvas
IP IP Logged
HEMREDDY
Newbie
Newbie


Joined: 31 Jul 2013
Online Status: Offline
Posts: 38
Quote HEMREDDY Replybullet Posted: 06 Dec 2013 at 8:20am
Hi,
 
Placed the Item No from table 2 in the detail section and added the isnull formula to the selection expert. Still getting a blank on the report.
 
Hem Reddy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Dec 2013 at 8:35am
remove your select statement,
place the item_no field from table 1 and table 2 on the detail section.
Do you get data now?
IP IP Logged
HEMREDDY
Newbie
Newbie


Joined: 31 Jul 2013
Online Status: Offline
Posts: 38
Quote HEMREDDY Replybullet Posted: 06 Dec 2013 at 8:44am
Hi,
 
Yes i am able to get the data now. I show matching records.
 
Hem, Reddy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Dec 2013 at 8:59am

you should have some blanks in the table 1 field.

If not check your join andmake sure you are doing an outer join from 2 to 1.
IP IP Logged
HEMREDDY
Newbie
Newbie


Joined: 31 Jul 2013
Online Status: Offline
Posts: 38
Quote HEMREDDY Replybullet Posted: 06 Dec 2013 at 9:18am
hi,
 
I think i explained the situation in wrong way. The Table 1 has more items than the table 2. Table 2 has just 15 items. Table 1 on the other hand has about 200.
If i change the jon from Table 1 to Table 2 then see nulls for column for teble 2 item number.
Hem Reddy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Dec 2013 at 9:22am
OK
Now that ou have your join right you select criteria will be
isnull(table2.item_no )
 
Use table 1 fields to display the number value
IP IP Logged
Page  of 2 Next >>
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