Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Combining Similar Records in a report Post Reply Post New Topic
Author Message
flik44
Newbie
Newbie
Avatar

Joined: 01 Sep 2009
Location: United States
Online Status: Offline
Posts: 3
Quote flik44 Replybullet Topic: Combining Similar Records in a report
     Posted: 01 Sep 2009 at 6:33am
There may be a post on this already on the forum, but I don't know the formal term for what I am trying to do.  If anyone knows and would be so kind to share, i would really appreciate it.
 
I have a database filled with automotive vehicle descriptions and associated parts for those vehicles.  I am setting my report up in a catalog type of lookup where the Make > Model > Submodels > then year and detail are listed, similar to this:

Cadillac
     Escalade
          All Submodels
                           1999       5.3L       Part #123
                           2000       5.3L       Part #123
                           2001       5.3L       Part #123
                           2002       5.3L       Part #123
                           ...
 
What I would like to do is use a tool or create a formula that will combine the years of otherwise similar records, such as:
 
Cadillac
     Escalade
          All Submodels
                          1999-2002       5.3L       Part #123
 
Does anyone know of a simple way to do this?  It would reduce the size of my report by approximately 70-80%...  Thanks for any help/advice....
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Sep 2009 at 7:32am
You can create a formula field to do this. Is there an item in the DB that shows this or can be used as a key? likely not so here is another approach that is tedious but likely needed...
if table.make="cadillac" and table.model="escalade" and submodel="all submodels" and table.year in 1999 to 2002 then "1999-2002" else
if ... next requirements here until all are accounted for. Then you can replace the year level group with this formula field, sort on part# and suppress details on duplication


Edited by DBlank - 01 Sep 2009 at 7:33am
IP IP Logged
flik44
Newbie
Newbie
Avatar

Joined: 01 Sep 2009
Location: United States
Online Status: Offline
Posts: 3
Quote flik44 Replybullet Posted: 01 Sep 2009 at 8:12am
Thank you for the reply, DBlank.  This would require me going through each set and setting the parameters, correct?  Or am I misunderstanding it?
 
I probably failed to mention that there are 21,000 records and hundreds of different groupsets... was looking for a way to hopefully automate the process.  Was thinking something like "if makes, model,submodels, engine sizes,part numbers & descriptons are all equal, then print lowest year &"-"& highest year, provided years are consecutive"
 
That was a long if then.... :)
 
I understand it may not be possible, but thought I would explain it a little better.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Sep 2009 at 8:38am

No way that I know of to that. Maybe outside of crystal in a complex view or stored procedure you could do that.

Are you set in your grouping process? maybe this would woprke for you...?
If you grouped on
Make
model
submodel
engine
part #
Details (suppress)
you could do a formula on parts group header as:
totext(Minimum(table.year,table.part#),0,"") + "-" + totext(Maximum(table.year,table.part#),0,"")
Would look something like
Cadillac
     Escalade
          All Submodels
                           5.3L 
                                  Part #123    1993-2000
                                  Part #124     1993-1995
                                  Part # 125    1991-2009
 
This assumes the part # is never reused and always applies to all models between a min and max.
at least something to think about.
IP IP Logged
flik44
Newbie
Newbie
Avatar

Joined: 01 Sep 2009
Location: United States
Online Status: Offline
Posts: 3
Quote flik44 Replybullet Posted: 01 Sep 2009 at 8:48am
This might work - I will need to check the parameters of my requirements.  The only other issue is that the parts will show up more than once for different applications.
 
I'll take a look, and thanks again for taking the time to help a newbie...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Sep 2009 at 8:51am
No worries on the parts showing up for different applications. They still will. It will only group them under the Make model, submodel, engine.
If there is the same part # for a different engine size it should still show up under that engine size (assuming the data behind the report supports that).
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