Page 1 of 1

Calculation Help

PostPosted: Wed May 17, 2006 6:50 am
by Guest
I need help writing a calculation that is conditional. I have made a database for company bid prices on items and want to total up each company's bid separately. The one condition is I only want it to total up the items for each company that has been chosen for purchase. If the item has be chosen for purchase from a company it will have a "y" in a field next to the item and company. Any direction will help.

Thanks

PostPosted: Wed May 17, 2006 9:07 am
by John Sindelar
Well this is kind of abstract, but you can handle this at the price level or at the bid level. At the price level you'd have a new price field that is really a calc, something like:

if ( Chosen = "Y" ; Amount ; 0 )

Then summing this field will get you the total amount of the chosen items.

At the bid level you could make a separate relationship between bids and items that was only true for chosen items; that means adding the "chosen" field to your relationship criteria somehow. Then you could have a sum calc in your bid that looks across this new relationship to sum the price of the chosen items:

sum (chosenitems::amount)

HTH.