Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for grouping

Status
Not open for further replies.

ginaburg

Technical User
Jul 14, 2004
62
US
I am using Crystal 8.5. I am trying to group on part of a field.
I have a field cost category which holds the following data
0114000001
0114000002
0114500001
0114500002
0115000001

I want to be able to group on the first 9 characters of the field. So my groups should be as follows
011400000
011450000
011500000

I know I need a formula in my group section but I cannot figure out what will make this work.

I appreciate any help you can give.
Gina
 
What about using the formula Left({table.field},9). This will get you just the left 9 numbers/letters, then you can use the formula to group on.
 
Actually I did that in the group options section and it lists the cost categories with 9 characters, but it doesn't group them together.
For instance I am getting
011450000
011450000

Am I doing the formula in the wrong place?
 
Yeah

The group options enables you to alter the name it will display for each group, but it is still grouping on the whole {table.field} value. What you want to do is create the formula like BParsons said as a new formula field. Then change your group from {table.field} to the formula you created.
 
You guys are wonderful, thanks very much.

I hate getting stuck on those simple things.

Gina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top