Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need Help Rolling Up Groups Post Reply Post New Topic
Author Message
johnsjg
Newbie
Newbie


Joined: 10 Jun 2013
Online Status: Offline
Posts: 7
Quote johnsjg Replybullet Topic: Need Help Rolling Up Groups
     Posted: 10 Jun 2013 at 6:49am

I am not looking to drilldown into the details area and I don't know if this is possible.  This is an example of what my report might look like:

Group  1                              Count of Records

>$100  (Group2)                                 20

$100-150  (Group2)                             3

$150-200  (Group2)                             3

$200-250  (Group2)                           380

$250-300  (Group2)                           175

$300-350  (Group2)                            14

 

Group 1

>$100 (Group2)                                     14

$100-150 (Group2)                               265

$150-200 (Group2)                               48

$200-250 (Group2)                               7

$250-300 (Group2)                               2

$300-350 (Group2)                               1

Group 2 is a formula field:
 
If {reportfield1} >= 1.0 and
{reportfield1} < 1.5 then "$100-150" else
 
etc.
 
Depending on Group 1 the ranges in Group 2 might have hundreds of records or just a couple.  When there are just a couple then I would like to combine those groups into a larger range and when there are hundreds of records I would like to break down the range for more detail.  Any help would be appreciated.


Edited by johnsjg - 10 Jun 2013 at 9:07am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Jun 2013 at 11:38am
I don't know if this doable, as I think that CR gets the aggregate values in a later read than the grouping.

I would try something like:
shared numbervar tot:=COUNT({table.field}, {grouping});
if tot < 10 then ...
if tot >= 10 and tot < 20 then ...

and try setting the grouping value on this new formula.

I don't think that you will be able to.

You could probably figure out something in a stored proc, even if it is only getting the count for each of the Group 1 values. Then CR could read this value and decide from there...but I don't think that you will be able to accomplish your variable grouping without a little extra help.

Hoping I'm wrong...
IP IP Logged
johnsjg
Newbie
Newbie


Joined: 10 Jun 2013
Online Status: Offline
Posts: 7
Quote johnsjg Replybullet Posted: 12 Jun 2013 at 6:57am
Dang, I was afraid of that.  I'll give this a shot and see if it works out.  Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jun 2013 at 7:24am
if you are not drilling down, the only thing I could think of is to create grouping levels and then conditionaly show or supress the group level headers based on counts inside each group level. To a user they would not know if they were looking at a group level 1, 2 or 3, but that is how you could 'break them up'.
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