Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Another groups that have Null data Post Reply Post New Topic
Author Message
jmarcink
Newbie
Newbie
Avatar

Joined: 22 Dec 2009
Location: United States
Online Status: Offline
Posts: 3
Quote jmarcink Replybullet Topic: Another groups that have Null data
    Posted: 22 Dec 2009 at 9:16am
Hi All,
 
I know Nulls in crystal can be a pain.  I can usually handle stuff with stored procedures, but this is not an option this time.  I have to use the tables and database linking in Crystal.  I am using all Outer Joins and get all my data.  My current Report looks like this:
 
REGION1
     Product 1     Volume1   Sales1
     Product 2     Volume2   Sales2
     Product 3     Volume3   Sales3
     Product 4     Volume4   Sales4
 
REGION2
     Product 1     Volume1   Sales1
     Product 3     Volume3   Sales3
     Product 4     Volume4   Sales4
 
REGION2
      Product 2     Volume2   Sales2
      Product 3     Volume3   Sales3
      Product 4     Volume4   Sales4
 
 
Some regions will not have a certain Product data, but I need to show
       Product 1     Volume1   Sales1
       Product 2     Volume2   Sales2
       Product 3     Volume3   Sales3
       Product 4     Volume4   Sales4
for all Regions.
 
Without a SQL Procedure, I can't for the life of me think of a grouping formula to pull back a certain product name if no data exists for it.
It may be one or two of the product names, but I have no data to do a check on.
 
I thought of creating a formula for the dynamic group and check for null, but although I can see something is null, I can't determine what Product# is supposed to be displayed due to that null.
 
 
The report is setup simply like
 
GH1 - REGION
GH2 - PRODUCT   SUMVOLUME   SUMSALES
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Dec 2009 at 6:32am

well even with a sql proc, using just outer joins, getting the missing products would be hard...not knowing the data tables, I think something like this would work:

select * from products left join sales left join regions
 
...but now you don't know which region, and Crystal will only let you use the data row once.
 
are the regions fixed?  If they are you might try using a Command object to retrieve products/region and then joining that on regions...lots of data reads.
 
Boy, wouldn't a stored proc be easier....if only you could.
 
HTH
IP IP Logged
jmarcink
Newbie
Newbie
Avatar

Joined: 22 Dec 2009
Location: United States
Online Status: Offline
Posts: 3
Quote jmarcink Replybullet Posted: 23 Dec 2009 at 12:45pm

Thanks for the reply, but not sure this will help. Yes, unfortunately I can't do it with a SP.

The regions are fixed using a formula that basically looks at a certain field of data and determines what regions it should be in, for us.
 
EX:
 
if {table.area} = "AP South" then
      "Asia Pac"
Else if {table.area} = "AP North" then
       "Asia Pac"
etc.
etc.
 
Else
        "Other"
 
 
I'll see if a command object will help, but haven't had to use one in a while.
 
 
Thanks.
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.016 seconds.