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:

syntax question, not in online refernce (1997) MATH (1998) flushdatabases (1997) Just Testing (1997) WebCat and image maps (1997) Strange intermittent WebDNA problems (2008) WCS Newbie question (1997) Please.. copies of Digest for 7/29 and 7/30? (1997) Future of WebDNA (was urls) (2005) Open Databases on Restart (1999) where to put code (1998) email [title] (1997) Enterprise Server (1998) Plugin or CGI or both (1997) WebCatalog 4.0 ? (2000) vars (2000) Sort Order on a page search (1997) WebCatalog 3.x (2003) Am I going senile? (Price recalc based on quantity) (1997) [WebDNA] How much does it cost now? (2008)