Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help! Crystal Formula Editor and tables Indexes Post Reply Post New Topic
Author Message
newcrystal
Newbie
Newbie


Joined: 27 Jul 2009
Online Status: Offline
Posts: 7
Quote newcrystal Replybullet Topic: Help! Crystal Formula Editor and tables Indexes
     Posted: 27 Jul 2009 at 10:18am

Hello...

I created two SQL Commands on Crystal Reports 2008. One for the CLIENTS table and one for the YEARS table. The YEARS table only stores the current year. I mean, I have thousands on rows on the CLIENTS table and only one row on the YEARS table.

I wanted to create a filter on my report only to retrieve the CLIENTS that where created on a particular year (the year stored in the YEARS table, wich will be changing dinamically).
 
The CLIENT table has a CREATION_YEAR column and it has an index.
 
I created the following filter in my report, using the Formula Editor:
 
{CLIENTS.CREATION_YEAR} = {YEARS.year}
 
The report takes too much time to generate, altough as I said, the CLIENTS table has an index on CREATION_YEAR.
 
My question is if Crystal not uses tables indexes when combining fields from differents Commands on a filter.
 
Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2009 at 10:30am
Did you inner join the command objects on the Year fields?
If so the {CLIENTS.CREATION_YEAR} = {YEARS.year} is redundant.
 
IP IP Logged
newcrystal
Newbie
Newbie


Joined: 27 Jul 2009
Online Status: Offline
Posts: 7
Quote newcrystal Replybullet Posted: 27 Jul 2009 at 12:36pm

No, I didn't joined the two tables...

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2009 at 12:38pm
The lack of the join itself will make it run slower.
You can simplify it by just doing an inner join in just one command object(no need for the second one to pull the date field).
Let us know if that resolves your problem.


Edited by DBlank - 27 Jul 2009 at 12:39pm
IP IP Logged
newcrystal
Newbie
Newbie


Joined: 27 Jul 2009
Online Status: Offline
Posts: 7
Quote newcrystal Replybullet Posted: 27 Jul 2009 at 2:16pm

Oh! sorry... I should have give you more information...

The two tables are on different systems.
 
Table CLIENTS is an ORACLE table that I manipulate trought SAP R3.
 
The table YEARS is a SYBASE IQ table.
 
I am doing an ETL extracting from SAP to Sybase IQ.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2009 at 3:53pm
Try and set an inner link on the two Commands. You may have to use a case statement in your COmmand to assign/make the fields the same type so they can be linked.  
Once you link them get rid of the select statement ("{CLIENTS.CREATION_YEAR} = {YEARS.year}") becasue the link does that for you, and see how your performance is.


Edited by DBlank - 27 Jul 2009 at 3:54pm
IP IP Logged
newcrystal
Newbie
Newbie


Joined: 27 Jul 2009
Online Status: Offline
Posts: 7
Quote newcrystal Replybullet Posted: 28 Jul 2009 at 6:33am

I created the inner join and eliminated the filter, but the result is the same...

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jul 2009 at 6:54am
Anyone else have any suggestions?
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