Associative lookup style?

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10781
interpreted = N
texte = In our setup we use the unitShipCost as a partial sum reflecting the mailing weight for each (item type * quantity) of order in the cart. We calculate this via a hidden input field in the invoice.tmpl. For some reason I couldn't get this to work via the formulas database. I used the same formula that it is in the value= string below.Now, I want to summate that field and use the resultant sum as an associative lookup in our countries database to determine the [shipCost] total. The countries database has the following fields: Country Group_Code half_lb one_lb two_lb three_lb four_lb five_lb addl_lbQUESTIONS:1) Would I get the total weight via [unitShipCostsumm=T] ?2) Assuming 1) if that total was 3.4 lbs. I would want to lookup under four_lb field for whatever country the shipping address was. How do you do an indexing type of lookup on a database field given one of the fields (country) is used as a lookup? e.g.My lookup algorithm is something like?[showif [unitShipCostsumm=T]<=5]][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[inde x_to_field(ciel([unitShipostsumm=T])+3]][/showif] [showif [unitShipCostsumm=T]>5][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[five _lb]+(([unitShipCostsumm=T] - 5) * [addl_lb]]][/showif]The other showif is if the total weight is over 5 lbs. Or do I have to do a whole bunch of showif tests for each case? Am I on the right track?Thanks for any help! Curt ---------------------------------------------------------------------- | William Curt Eggemeyer Curt@mail.bzzzzzz.com | | BeeHive Technologies, Inc. | | http://www.bzzzzzz.com with a WebCam in Pasadena, California | ---------------------------------------------------------------------- Associated Messages, from the most recent to the oldest:

    
  1. Re: Associative lookup style? + bit more (Grant Hulbert 1997)
  2. Re: Associative lookup style? + bit more (w curt eggemeyer 1997)
  3. Re: Associative lookup style? + bit more (Grant Hulbert 1997)
  4. Re: WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (Grant Hulbert 1997)
  5. Re: Associative lookup style? + bit more (w curt eggemeyer 1997)
  6. WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (Sven U. Grenander 1997)
  7. Re: Associative lookup style? (Grant Hulbert 1997)
  8. Associative lookup style? (w curt eggemeyer 1997)
In our setup we use the unitShipCost as a partial sum reflecting the mailing weight for each (item type * quantity) of order in the cart. We calculate this via a hidden input field in the invoice.tmpl. For some reason I couldn't get this to work via the formulas database. I used the same formula that it is in the value= string below.[math][lookup db=catalog.txt&lookInField=sku&value=[sku]&returnField=weight]*[quantity][/ math]>Now, I want to summate that field and use the resultant sum as an associative lookup in our countries database to determine the [shipCost] total. The countries database has the following fields: Country Group_Code half_lb one_lb two_lb three_lb four_lb five_lb addl_lbQUESTIONS:1) Would I get the total weight via [unitShipCostsumm=T] ?2) Assuming 1) if that total was 3.4 lbs. I would want to lookup under four_lb field for whatever country the shipping address was. How do you do an indexing type of lookup on a database field given one of the fields (country) is used as a lookup? e.g.My lookup algorithm is something like?[showif [unitShipCostsumm=T]<=5]][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[inde x_to_field(ciel([unitShipostsumm=T])+3]][/showif] [showif [unitShipCostsumm=T]>5][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[five _lb]+(([unitShipCostsumm=T] - 5) * [addl_lb]]][/showif]The other showif is if the total weight is over 5 lbs. Or do I have to do a whole bunch of showif tests for each case? Am I on the right track?Thanks for any help! Curt ---------------------------------------------------------------------- | William Curt Eggemeyer Curt@mail.bzzzzzz.com | | BeeHive Technologies, Inc. | | http://www.bzzzzzz.com with a WebCam in Pasadena, California | ---------------------------------------------------------------------- w curt eggemeyer

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

How do I handle extra spaces? (2002) Getting Crazy (1998) WebCat2 - many [carts] on one template page? (1997) WebCat & Backoffice Solution? (2000) Multiple fields on 1 input (1997) Search all Fields in a db (1997) [WebDNA] Don't change [ipaddress] ... (2015) WebDelivery downloads alias, not original ? (1997) Sorting by type=date (1999) Emailer (1997) [showif] and equality (1998) Trouble with formula.db (1997) WebDNA 6.x - Compatibility with Fedora release 1? (2004) PIXO Support (1997) Migrating to NT (1997) Bug? (1997) Bad URL reference? (1997) $Replace with [founditems] (1997) WebCatalog can't find database (1997) [cart] clarification... (1997)