Link to home
Start Free TrialLog in
Avatar of Carlo
CarloFlag for United States of America

asked on

How to group in Crystal Reports a field with contained values of 5's

I want to be able to group the unitCost value by increments of amount value in 5 in Crystal Reports 2008.
How is this accomplished?


Example:

Group 1
Item ID      Unitcost
AB123        1
AB124         2
AB125        3
AB126        5

Group 2
Item ID      Unitcost
CD123      6
CD124      6
CD125      7
CD126      10

Group 3
Item ID      Unitcost
CE123       11
CD124      12
CD127      14
CD128     15

Please help. Thanks.
Avatar of Mike McCracken
Mike McCracken

Add a formula like this and group on it

whilereadingrecords;
global numbervar myrecnum;
myrecnum:= myrecnum + 1;
myrecnum \ 5

Open in new window


The first group will only have 4 records but after that they should have 5
mlmcc
Avatar of Carlo

ASKER

mlmcc, I apologize I wrote it wrong....
I want the values in that field, unitCost, to be group by increments of every 5 dollar amounts.

So everything that has a value in UnitCost from 0 to 5 I Want it grouped.
Then everything from 6 to 10 I want it groups and so on...incremental values of 5 in the field.

Your answer was good though.
Try this formula

{Value Field} \ 5

Open in new window

Avatar of Carlo

ASKER

Good call though but that didn't go to well since I have values of 0.00.
If you wish to call Group 0 Group 1, just add 1 to the expression mlmcc provided.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Carlo

ASKER

Thanks mlmcc all I had to do then was group the report by that formula!