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!

either/or formula

Status
Not open for further replies.

sorchard2000

Technical User
Aug 3, 2004
57
US
Crystal 8.5
SQL Server

I am trying to create a report that has items listed based on inventory locations. Unfortunately, some items have 2 inventory locations listed.

example data:

sponge inventory location #1
notebook inventory location #4
book inventory location #1
book inventory location #4

I would like crystal to choose one OR the other but not both. (I don't care which inventory location it uses.) I currently have this formula in my grouping but when I use it, it only will list items in inventory group #1-virtually ignoring any items in inventory group #4. formula reads as:

if {supinvitemlist.supinvloc_id} = [1.00,4.00]
then{supinvitemlist.supinvloc_id} = 1.00 else {supinvitemlist.supinvloc_id} = 4.00

I would like the example data to read as:

sponge inventory location #1
notebook inventory location #4
book inventory location #4

Hope I've made this clear. I'm sure I've written the formula wrong.

Thanks
sorchard2000
 
Generally people use a FIFO system for pulling inventory, which is dependent upon a date.

To handle your requirements is similar, Group by the product, and then go into Report->Edit Selection Formula->Record and place something like:

{table.location}=maximum({table.location},{Table.product})

You'll get one per product.

If you do have a date which uniquely reflects age, use:

{table.date}=maximum({table.date},{Table.product})

-k
 
1) You could insert a group on {table.item} and then drag the detail fields into the group header or footer. Then suppress the detail section.

2) Or you could group on {table.item} and go to report->edit selection formula->GROUP and enter:

{table.inventorylocation} = maximum({table.inventorylocation},{table.item})

3) Or you could go to format->section->details->suppress->x+2 and enter:

{table.item} = previous({table.item})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top