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

group on formula

Status
Not open for further replies.

buddyel

MIS
Mar 3, 2002
279
US
I have a report that lists the orders for the current day broken down by division...
Work Order # Range
Division 1 : 100000 - 199999
Division 2 : 200000 - 299999
Division 3 : 300000 - 399999
Division 4 : 400000 - 499999
Division 5 : 500000 - 599999

Right now the report prompts the user for a division (?Divison) and only looks in the range specified for that division. What I would like is to not prompt the user for a response and just automatically print division 1 through 5, each division on a separate page. This is roughly how the code looks now..

if (?Division) = 1 then {BKARINV_INV_WONUM} in 100000 to 199999
etc...

how can i group on something like this? Any tips are greatly appreciated...

 
If I understand your requirement, you want to create a formula to use as the Group by, which is based on work order numbers.

What I don't fully grasp is why you can't just group by the division number?

Anyway, try something like:

@DivisionGroupFormula
if {BKARINV_INV_WONUM} in [100000 to 199999] then
"Division 1"
else
if {BKARINV_INV_WONUM} in [200000 - 299999] then
"Division 2"
else
...

Group by this formula.

-k kai@informeddatadecisions.com
 

I would have it group by the division number, but i didnt think you could group based on a parameter and thats all the divison is, it doesnt actually exist in the database
 

Now, My ?Division parameter is set up to accept multiple values. But the report will only show the the first entered value, do you know how i can fix this?

 
I thought that you weren't going to prompt for users?

Anyway, if you mean that you want to display the list of parameters entered:

join({?Division},", ")

You can replace the ", " with whatever you'd like to delimit the entries with, such as a chr(13) for a carriage return.

If you want to limit the rows that the report returns to just those in the parameter list, add to the record selection criteria something like:

{MyTable.MyDivision} = {?Division}

-k kai@informeddatadecisions.com
 

Using the join, it just shows up as "1,2,3,4,5" on the report.

I really dont want to prompt but when i modified the report to accept 1 through 5 automatically, the report listed all the work order numbers on the first page and put the corresponding group header before each record. like so.

Divison 1
121318
Division 1
121319
Divison 2
220397

I want on one page ..
Division 1
121318
121319

and on the other page...
Division 2
220397
220398
 
This looks like you're grouping by Division and work order, when you really just want to group by division.

If you want help with it, share the details, such as the groupings used, where the fields are placed, etc.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top