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:

Cart Number Propagation (1997) how do ye do this?????? (2001) Version 2.0 and 1.6 simultaneous (1997) Max Record length restated as maybe bug (1997) RE: I have observed and I am gone. (1998) Web Catalog 2 demo (1997) Turning a URL into a link (2003) Cookie still not working (1999) WC2b15 File Corruption (1997) calculating tax rates, mail order solutions and version 2 (1997) Formulas.db + Users.db (1997) WebCatalog Technical Reference (1997) Tiny Store (1998) Nested vs conditional (1997) flushdatabases (1997) upgrading (1997) CPU Usage 165% (2005) Re:2nd WebCatalog2 Feature Request (1996) Date Formats (1997) WebCat2: multiple currency support (1997)