Group Specified on a non recurring field - another twist

I have a situation which I'm sure many people have run into:

My recordset contains items which need to be grouped by manufacturer status. If the status of a particular item is unavaiable but other items by the manufacturer are available, the manufacturer status needs to be set to available. However, if all the items by the manufacturer are unavailable, the status of the manufacturer should be unavailable.

I wrote a formula to do a distict count on the item status at the manufacturer level and compare that to the item status. If the distinct count > 1, the manufacturer status is set to 'A'. If the distinct count = 1 and item status = 'U', the manufacturer status is set to 'U'. Else the manufacturer status is set to 'A'. That all works fine.

Now for the twist. I need to group all the available manufacturera together and all the unavailable manufacturers together. I can't do this based on my manufacturer status formula because it uses the distinct count function.

I'm using Crystal 8.5. The report is being run off a single SQL stored procedure which is shared by other reports, so I can't change it to do this modification within the sp. I would love to use a SQL Expression, but they aren't available in 8.5.

There has to be a way to group based on a variable in Crystal. Does anyone know the way? Do I need a evaluation time function somewhere along the line? Use Variables?

Thanks in advance!
LVL 1
bbgbpAsked:
Who is Participating?
 
GJParkerConnect With a Mentor Commented:
The way I would do this is to create a formula to test for the status i.e.

//@Status - place this in the details section
if {MyTable.Status} = 'A' then 1 else 0

create a group on supplier and create a sum summary of teh @status formula, then Unavailable suppliers  = 0 and Available suppliers <> 0

then insert a group sort Report -> Group sort expert

For this group sort = All
based on = Sum of @Status

Hope this helps

Gary
0
 
bbgbpAuthor Commented:
Gary,

I'll give that a shot. Thanks for the idea!
0
All Courses

From novice to tech pro — start learning today.