Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping Categories Post Reply Post New Topic
Author Message
mplatero
Newbie
Newbie


Joined: 26 Apr 2011
Online Status: Offline
Posts: 4
Quote mplatero Replybullet Topic: Grouping Categories
     Posted: 26 Apr 2011 at 10:26am
I have the following formula, but doesn't seem to work.  I need a formula to group "returned mail" and "ppn returned mail" together under one category; "Returned/Undeliverable Mail" 
 
else if {Open.Area} = "returned mail"
then "Returned/Undeliverable Mail"
else if {Open.Area} = "ppn returned mail"
then "returned mail"
 
Please help.....
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Apr 2011 at 3:20am
if you want to group them in 1 category, then they need to return the same value...CR is not going to call the function recursively...
 
else if {Open.Area} = "returned mail"
then "Returned/Undeliverable Mail"
else if {Open.Area} = "ppn returned mail"
then "Returned/Undeliverable Mail"
 
or
local stringvar x := {Open.Area};
if  x:= "ppn returned mail"
then x:="returned mail"
 
if x = "returned mail"
then x:="Returned/Undeliverable Mail";
 
local stringvar x := {Open.Area};
if x = "returned mail" or x = "ppn returned mail" then
  "Returned/Undeliverable Mail"
 
HTH

or
 
IP IP Logged
mplatero
Newbie
Newbie


Joined: 26 Apr 2011
Online Status: Offline
Posts: 4
Quote mplatero Replybullet Posted: 27 Apr 2011 at 4:35am
I'm sorry, this is the actual formula i was using, which is the first forumula you suggested.
 
else if {Open.Area} = "returned mail"
then "Returned/Undeliverable Mail"
else if {Open.Area} = "ppn returned mail"
then "Returned/Undeliverable Mail"
 
However, this does not group them together.  For example, there are 50 in the returned mail category and 50 in the ppn returned mail category.  I want them both under Retruned/Undeliverabel Mail totaling 100.  But when i use this code, it does change the category title to what i want it, but it does not group them together giving me a toal of 100.  It gives me two categories with the same title, but each with 50.  And this is just a small sample, i have about 25 other categories i'm working with on this report.  But, these are the two i'm trying to get grouped together. 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Apr 2011 at 6:32am
for the grouping criteria, is it looking at the {open.area} or at the formula.
 
You should be grouping on the formula, as it has the values that you want.
 
I right click on the group, select change group, then in the drop down, instead of the field, select the formula.
 
That should do the trick.
IP IP Logged
mplatero
Newbie
Newbie


Joined: 26 Apr 2011
Online Status: Offline
Posts: 4
Quote mplatero Replybullet Posted: 28 Apr 2011 at 12:10pm
That does not seem to work.  When i select the formula for grouping, i select "OK".  And nothing happens.  I go back into the group change selection, and no changes were made.  It seems as though it did not save my changes.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 29 Apr 2011 at 2:00am
hmmm....
Sorry, I have never had that happen, so I am not sure what is going on.
 
You might try making another simple formula, which can be anything, say returning the first letter of some field, or just another field and see if that works.
 
Maybe there is something in the formula that is not 'known' by just looking at the data, and that is causing the behavior.
 
Sorry, I don't know why CR is acting as it is.
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