Grouping only certain values into a group

bryant1
bryant1 used Ask the Experts™
on
I am looking to make an expense report in Crystal.  The database has several fields that relate to the same general type of expenses(eg. Salary & Wages - Temp; Salary & Wages - Manager)  that i want to sum up under a single Salary Heading, and not show the indivual groups.  the database has account numbers and i know what account #'s i want under each heading; however I cannot figure out how to incorparate this logic into CR 11.5.

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004
Commented:
You can use either Specified Order Grouping, or you can create a formula and then group on that.
I find that creating a formula is an easier solution that is much easier to maintain.

So, create a formula using this structure:

//@Grouping
select {table.account}
 case "100101","100102","100103" : "Salary"
 case "201102" : "Rent"
 etc.

Build out the formula, then just insert a group, using the formula as the field to group on.
Run your report and make any adjustments from there.
You can specify your own groups with your own names when you Insert a group on a particular field.
When you get the Insert Group dialog choose 'In specified order ' from the sort sequence drop down.
This open up a new dialog box which allows to specify a group name - click New and then add all the Account nos that make up that group. Repeat as necessary for each New group.

Author

Commented:
Ok that formula that bdreed gave me seems to work, but it will not sum of the total for the group.. any ideas why?
Top Expert 2004

Commented:
The formula I gave you only allows you to group records, not sum them.
Once you create the group, you should be able to insert a summary on any numeric field that you need a sum for.

Author

Commented:
Thanks, Worked like a charm

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial