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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using formula for grouping 1

Status
Not open for further replies.

AZdesertdog

IS-IT--Management
Dec 2, 2003
88
US
I have v10 and am trying to write a formula that will do my grouping for me but I'm running into problems. I seem to be unintentionally creating a boolean.

What I have so far is a list of 'Areas' with dollar totals associated to them. (All my results are viewed in the group footer/headers as I'm using a transactional dbase and need to suppress the details)


Currently have;

RH> Area Desc Currentbal
--------------------------------------------
GF1> 005 Bakersfield $45,456
GF1> 1234 Jonestown $1,234,234
GF1> 232 Phlugerville $456,454
GF1> 044 Westville $34,333
GF1> 2483 Johnsonville $1,232
GF1> 192 Passington $34,567

I've created 'division' parameter fields ie., North,South,West.
Each of these 'Divisions' have one or more 'Areas' in them. I want to prompt the user for the Division and then have the grouping appropriate to the areas in that division and using it's name as the group label.

For example if Division 'North' includes Areas 005,1234,232 and Division 'South' includes areas 044,2483,92. My expected results would be:

GH1>NORTH
GH1a>Area Desc Currbal
--------------------------------------------
GF2>005 Bakersfield $45,456
GF2>1234 Jonestown $1,234,234
GF2>232 Phlugerville $456,454

GH1>SOUTH
GH1a>Area Desc Currbal
--------------------------------------------
GF1>044 Westville $34,333
GF1>2483 Johnsonville $1,232
GF1>192 Passington $34,567

The formula for I was trying to use to group on was something like this:
IF {?Division}= 'North' then {org.area} in ['005','1234',232'] else
IF {?Division}= 'South' then {org.area} in ['044','2483','192']

This gave me a true false boolean. I know there is something simple I'm missing to do this. Any help appreciated. Thanks!
 
I think you are mixing up record selection with grouping. Your grouping formula should look like:

if {org.area} in ['005','1234',232'] then "North" else
if {org.area} in ['044','2483','192'] then "South"

Then if you want to select only North or South, add the parameter to your record selection formula, using your original formula:

IF {?Division}= 'North' then {org.area} in ['005','1234',232'] else
IF {?Division}= 'South' then {org.area} in ['044','2483','192']

-LB
 
Thanks, LB. That's just what I was looking for. Once again you save the day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top