Print Page | Close Window

Change the Group Name Field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14850
Printed Date: 07 May 2024 at 7:49pm


Topic: Change the Group Name Field
Posted By: dawnh44
Subject: Change the Group Name Field
Date Posted: 02 Nov 2011 at 11:35am
Hello,
 
Please help.  I have 3 group names.
  1. Primary
  2. Spouse
  3. Family Member

These are Group Name Fields.  How do I create a formula to change Primary to Employee?

Thank you.



Replies:
Posted By: hilfy
Date Posted: 02 Nov 2011 at 4:01pm

Try something like this:

If {table.groupfield} = 'Primary' then 'Employee' else {table.groupfield}
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: dawnh44
Date Posted: 03 Nov 2011 at 3:30am
Thank you, but I keep getting a message stating that a boolean is required here.  Please see my formula below:
 
{S_ORG_EXT.PAR_OU_ID} = "1-9FCGA" and
if {S_CONTACT_X.ATTRIB_42} = 'Primary' then 'Employee'
else {S_CONTACT_X.ATTRIB_42}
 
 


Posted By: DBlank
Date Posted: 03 Nov 2011 at 3:56am
move your if up in the statement
if {S_ORG_EXT.PAR_OU_ID} = "1-9FCGA" and
{S_CONTACT_X.ATTRIB_42} = 'Primary' then 'Employee'
else {S_CONTACT_X.ATTRIB_42}


Posted By: dawnh44
Date Posted: 03 Nov 2011 at 4:22am
Sorry.  I'm still getting the boolean error. 
 
Thanks


Posted By: DBlank
Date Posted: 03 Nov 2011 at 4:46am
Are you putting this in the select expert or in the Field Explorer > Formula Fields ? or somewhere else?


Posted By: dawnh44
Date Posted: 03 Nov 2011 at 4:59am
Hello,
 
I'm putting this in the select expert, although I think I'm handling this in the wrong way. 
 
Here's the situation.  I have a Group in the Group Footer called s_contact_x.attrib_42 A in ascending order.  There are 3 groups in this group:
 
1.  Family
2.  Spouse
3.  Primary
 
I need to change all of the Primary's listed in the report to "Employee".  I also need to sort this in the following order:
 
1.  Employee
2.  Spouse
3.  Family.
 
I know how to do the sort order, but I can't seem to change Primary to Spouse.  Any ideas?
 
Thank you in advance.


Posted By: DBlank
Date Posted: 03 Nov 2011 at 5:07am
the select expert is used only to filter data.
 
I am not sure what you mean by a 'group' in a group footer.
If you are grouping on the a field (s_contact_x.attrib_42 A) that has 3 values in it use the
field explorer,
formula field,
right click and select NEW
name it whatever you want (something like 'name_with_employee')
add the formula that hilfy suggested
if {s_contact_x.attrib_42 A}='primary' then 'Employee' else {s_contact_x.attrib_42 A}
Niow use the formula field to group on instead of your original field.


Posted By: dawnh44
Date Posted: 03 Nov 2011 at 3:21pm
Hello,
 
Thank you, thank you, thank you so much.  I really appreciate your help.
 
Dawn



Print Page | Close Window