Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping data with exceptions? Post Reply Post New Topic
Author Message
susanr
Newbie
Newbie
Avatar

Joined: 15 Jun 2011
Online Status: Offline
Posts: 10
Quote susanr Replybullet Topic: Grouping data with exceptions?
     Posted: 16 Jun 2011 at 2:59am

Hi

Can anyone tell me if its possible to group the same data set more than once but with parameters?
 
My report is currently grouped by how many orders there are for each product, and then returns the top 100 products.
 
However, there is an exception, I need a certain product to be included whether its in the top 100 or not?
 
Any suggestions?
 
 
Susan
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Jun 2011 at 3:08am
I believe that I have done this, but offhand it wouldn't be able to tell you for sure.
 
So, what your report will return is 100-101 products depending of if this product makes it into the top 100, right?
 
Sounds like the grouping criteria would be something like top 100 or {table.productfield}="xxx"
 
I haven't done a top x type report, so perhaps someone else can give a better answer.
IP IP Logged
susanr
Newbie
Newbie
Avatar

Joined: 15 Jun 2011
Online Status: Offline
Posts: 10
Quote susanr Replybullet Posted: 16 Jun 2011 at 3:13am
lets say for arguments sake the product i need to include isn't in the top 100, but i need to figure out a way for the report to include it.
 
So...e.g.
 
top 100 products plus all products which start with "xxx"
Susan
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jun 2011 at 4:07am
are you curretnly using the crystal Group Sort Expert to get your top 100 or some other process?
IP IP Logged
susanr
Newbie
Newbie
Avatar

Joined: 15 Jun 2011
Online Status: Offline
Posts: 10
Quote susanr Replybullet Posted: 16 Jun 2011 at 5:11am
Yes, using the group sort expert.
Susan
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jun 2011 at 5:24am

if the value is in the top 100 do you only take 100 or the top 100 that are not that value (101 total) ot just the 100?

Where does the special value have to go? Always first , always last or always wherever it falls in the listing (last only if it is >100)?
IP IP Logged
susanr
Newbie
Newbie
Avatar

Joined: 15 Jun 2011
Online Status: Offline
Posts: 10
Quote susanr Replybullet Posted: 16 Jun 2011 at 5:36am
always last, i.e. 100 normal values, and if there are 10 special values, then i would take the top 90 normal values and add on the 10 special.
Susan
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jun 2011 at 5:50am
I am not aware of any way to add in additional code to the way Top N functions so I would try a work around to do what you want using suppression.
use a formula to zero out the values for your exception list
TopNexceptions
if field in (excption list here) then -1 else value
sum or count this formula field for your grouping,
do a sort of all records on this summary, your exceptions should always be the last few records
insert a RT as a counter of the groups
name=suppression counter
fiekld to suimmarize = grouped on field
type=distinct count
evaluate=for all records
reset=never
place in group header
now you can use your RT and your exception list to suppress your data
 
 
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