Re: Summing results of a nested search

This WebDNA talk-list message is from

2006


It keeps the original formatting.
numero = 67885
interpreted = N
texte = Oyyy... Just for the sake of completeness, the [writefile] should look like [writefile]sku title quantity category [/writefile] It wrapped wrong in Apple Mail... -Will On Aug 7, 2006, at 3:20 PMCDT, WJ Starck wrote: > Here's another way using a temp database (I'm bored today ;) > > [!]##### This sections fills a temp db with the skus and quantities > of all the unfilled orders #######[/!] >  > [search db=../catalog.db&eqinstockdatarq=T] >  [founditems] >  [math show=f]quantity[sku]=0[/math] >  [/founditems] > [/search] >  >  > [writefile ../dbs/filledtemp.db]skutitlequantitycategory > [/writefile] >  >  >  [search db=../ > orders.db&neshippeddatarq=T&eqapproveddatarq=T] >  [founditems] >  [search db=../lineitems.db&eqordernamedatarq=[ordername]] >  [founditems] >  [math show=f]quantity[sku]=([interpret][quantity > [sku]][/interpret]+[quantity])[/math] >  [replace db=../dbs/filledtemp.db&eqskudatarq=[sku] > &append=T]sku=[sku]&quantity=[interpret][quantity[sku]][/interpret] > &title=[lookup db=../catalog.db&value=[sku] > &lookinfield=sku&returnfield=title]&category=[lookup db=../ > catalog.db&value=[sku]&lookinfield=sku&returnfield=category][/replace] >  [/founditems] >  [/search] >  [/founditems] >  [/search] >    > 
>   >  [search db=../dbs/filledtemp.db&neskudata=[blank] > &ascategorysort=1&astitlesort=2&asskusort=3] >  [founditems] > >  [sku] [title] [quantity] > > [/founditems] >  [/search] > > [!]############ end section ##############[/!] > > > Cheers, > > Will > > > > > On Aug 7, 2006, at 1:54 PMCDT, WJ Starck wrote: > >> Thanks. >> >> I don't think it's possible to do what I want because it appears >> to be a database design issue. >> >> So, instead, I add a field [filled] to the lineitems database, >> which gets toggled to "T" when an order is filled. >> >> Then, in my template: >> >> [!]###--------Initialize variable quantity[sku]-------###[/!] >> >> [search db=../catalog.db&eqinstockdatarq=T] >>  [founditems] >>  [math show=f]quantity[sku]=0[/math] >>  [/founditems] >>  [/search] >>  >> [!]###-------do the math-------###[/!] >> >>  [search db=../lineitems.db&nefilleddatarq=T] >>   [founditems] >> [math show=f]quantity[sku]=([interpret][quantity[sku]][/ >> interpret]+[quantity])[/math] >>  [/founditems] >> [/search] >>  >> >> [!]###-------Display results-------###[/!] >> >> [search db=../lineitems.db&nefilleddatarq=T&skusumm=T] >>   [founditems] >> [sku] [title] [interpret][quantity[sku]][/interpret] >>  [/founditems] >> [/search] >> >> That did the trick. >> >> Thanks all.... >> >> -- >> Will Starck >> NovaDerm Skincare Science >> http://www.novaderm.com >> helpdesk@novaderm.com >> 866-892-4149 >> >> >> >> >> On Aug 7, 2006, at 11:43 AMCDT, Gary Krockover wrote: >> >>> Perhaps this (untested): >>> >>> [search db=orders.db&nefilledata=T] >>> [founditems] >>> [search db=lineitems.db&neskudata=[blank]] >>> [founditems] >>> [search >>> db=lineitems.db&eqskudatarq=[sku]] >>> [founditems] >>> [sku] [sum >>> field=quantity] >>> [/founditems] >>> [/search] >>> [/founditems] >>> [/search] >>> [/founditems] >>> [/search] >>> >>> Gary >>> >>> At 11:29 AM 8/7/2006, you wrote: >>>> Can't get my brain around this one. >>>> >>>> Our orders are written to 2 databases, orders.db and lineitems.db. >>>> >>>> I want to display a summary listing of the quantities of the skus >>>> for all of the orders that haven't been filled so we can pick them >>>> from the warehouse. >>>> >>>> So, if I had several orders like this: >>>> >>>> Order 1: >>>> >>>> sku qty >>>> ----------------- >>>> 001 5 >>>> 003 1 >>>> >>>> Order 2: >>>> sku qty >>>> ----------------- >>>> 001 1 >>>> 004 12 >>>> 006 5 >>>> >>>> My results would look like: >>>> >>>> sku qty >>>> ------------------ >>>> 001 6 >>>> 003 1 >>>> 004 12 >>>> 006 5 >>>> >>>> But how? >>>> >>>> >>>> I can get a non summated listing by doing: >>>> >>>> [search db=orders.db&nefilledata=T] >>>> [founditems] >>>> [search db=lineitems.db&neskudata=[blank]] >>>> [founditems] >>>> [sku] [quantity] >>>> [/founditems] >>>> [/search] >>>> [/founditems] >>>> [/search] >>>> >>>> But how do I get a summated listing? It seems [table] should do >>>> what >>>> I want, but I'm not certain how to code this inside a nested >>>> search. >>>> >>>> Any ideas? >>> >>> >>> ------------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> To switch to the DIGEST mode, E-mail to >> digest@talk.smithmicro.com> >>> Web Archive of this list is at: http://webdna.smithmicro.com/ >> >> >> >> >> >> >> >> ------------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to > digest@talk.smithmicro.com> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > -- > Will Starck > NovaDerm Skincare Science > http://www.novaderm.com > helpdesk@novaderm.com > 866-892-4149 > > > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ -- Will Starck NovaDerm Skincare Science http://www.novaderm.com helpdesk@novaderm.com 866-892-4149 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Summing results of a nested search ( Terry Wilson 2006)
  2. Re: Summing results of a nested search ( WJ Starck 2006)
  3. Re: Summing results of a nested search ( Stuart Tremain 2006)
  4. Re: Summing results of a nested search ( WJ Starck 2006)
  5. Re: Summing results of a nested search ( Gary Krockover 2006)
  6. Re: Summing results of a nested search ( WJ Starck 2006)
  7. Re: Summing results of a nested search ( WJ Starck 2006)
  8. Re: Summing results of a nested search ( WJ Starck 2006)
  9. Re: Summing results of a nested search ( Gary Krockover 2006)
  10. Re: Summing results of a nested search ( Clint Davis 2006)
  11. Summing results of a nested search ( WJ Starck 2006)
Oyyy... Just for the sake of completeness, the [writefile] should look like [writefile]sku title quantity category [/writefile] It wrapped wrong in Apple Mail... -Will On Aug 7, 2006, at 3:20 PMCDT, WJ Starck wrote: > Here's another way using a temp database (I'm bored today ;) > > [!]##### This sections fills a temp db with the skus and quantities > of all the unfilled orders #######[/!] >  > [search db=../catalog.db&eqinstockdatarq=T] >  [founditems] >  [math show=f]quantity[sku]=0[/math] >  [/founditems] > [/search] >  >  > [writefile ../dbs/filledtemp.db]skutitlequantitycategory > [/writefile] >  >  >  [search db=../ > orders.db&neshippeddatarq=T&eqapproveddatarq=T] >  [founditems] >  [search db=../lineitems.db&eqordernamedatarq=[ordername]] >  [founditems] >  [math show=f]quantity[sku]=([interpret][quantity > [sku]][/interpret]+[quantity])[/math] >  [replace db=../dbs/filledtemp.db&eqskudatarq=[sku] > &append=T]sku=[sku]&quantity=[interpret][quantity[sku]][/interpret] > &title=[lookup db=../catalog.db&value=[sku] > &lookinfield=sku&returnfield=title]&category=[lookup db=../ > catalog.db&value=[sku]&lookinfield=sku&returnfield=category][/replace] >  [/founditems] >  [/search] >  [/founditems] >  [/search] >    > 
>   >  [search db=../dbs/filledtemp.db&neskudata=[blank] > &ascategorysort=1&astitlesort=2&asskusort=3] >  [founditems] > >  [sku] [title] [quantity] > > [/founditems] >  [/search] > > [!]############ end section ##############[/!] > > > Cheers, > > Will > > > > > On Aug 7, 2006, at 1:54 PMCDT, WJ Starck wrote: > >> Thanks. >> >> I don't think it's possible to do what I want because it appears >> to be a database design issue. >> >> So, instead, I add a field [filled] to the lineitems database, >> which gets toggled to "T" when an order is filled. >> >> Then, in my template: >> >> [!]###--------Initialize variable quantity[sku]-------###[/!] >> >> [search db=../catalog.db&eqinstockdatarq=T] >>  [founditems] >>  [math show=f]quantity[sku]=0[/math] >>  [/founditems] >>  [/search] >>  >> [!]###-------do the math-------###[/!] >> >>  [search db=../lineitems.db&nefilleddatarq=T] >>   [founditems] >> [math show=f]quantity[sku]=([interpret][quantity[sku]][/ >> interpret]+[quantity])[/math] >>  [/founditems] >> [/search] >>  >> >> [!]###-------Display results-------###[/!] >> >> [search db=../lineitems.db&nefilleddatarq=T&skusumm=T] >>   [founditems] >> [sku] [title] [interpret][quantity[sku]][/interpret] >>  [/founditems] >> [/search] >> >> That did the trick. >> >> Thanks all.... >> >> -- >> Will Starck >> NovaDerm Skincare Science >> http://www.novaderm.com >> helpdesk@novaderm.com >> 866-892-4149 >> >> >> >> >> On Aug 7, 2006, at 11:43 AMCDT, Gary Krockover wrote: >> >>> Perhaps this (untested): >>> >>> [search db=orders.db&nefilledata=T] >>> [founditems] >>> [search db=lineitems.db&neskudata=[blank]] >>> [founditems] >>> [search >>> db=lineitems.db&eqskudatarq=[sku]] >>> [founditems] >>> [sku] [sum >>> field=quantity] >>> [/founditems] >>> [/search] >>> [/founditems] >>> [/search] >>> [/founditems] >>> [/search] >>> >>> Gary >>> >>> At 11:29 AM 8/7/2006, you wrote: >>>> Can't get my brain around this one. >>>> >>>> Our orders are written to 2 databases, orders.db and lineitems.db. >>>> >>>> I want to display a summary listing of the quantities of the skus >>>> for all of the orders that haven't been filled so we can pick them >>>> from the warehouse. >>>> >>>> So, if I had several orders like this: >>>> >>>> Order 1: >>>> >>>> sku qty >>>> ----------------- >>>> 001 5 >>>> 003 1 >>>> >>>> Order 2: >>>> sku qty >>>> ----------------- >>>> 001 1 >>>> 004 12 >>>> 006 5 >>>> >>>> My results would look like: >>>> >>>> sku qty >>>> ------------------ >>>> 001 6 >>>> 003 1 >>>> 004 12 >>>> 006 5 >>>> >>>> But how? >>>> >>>> >>>> I can get a non summated listing by doing: >>>> >>>> [search db=orders.db&nefilledata=T] >>>> [founditems] >>>> [search db=lineitems.db&neskudata=[blank]] >>>> [founditems] >>>> [sku] [quantity] >>>> [/founditems] >>>> [/search] >>>> [/founditems] >>>> [/search] >>>> >>>> But how do I get a summated listing? It seems [table] should do >>>> what >>>> I want, but I'm not certain how to code this inside a nested >>>> search. >>>> >>>> Any ideas? >>> >>> >>> ------------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> To switch to the DIGEST mode, E-mail to >> digest@talk.smithmicro.com> >>> Web Archive of this list is at: http://webdna.smithmicro.com/ >> >> >> >> >> >> >> >> ------------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to > digest@talk.smithmicro.com> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > -- > Will Starck > NovaDerm Skincare Science > http://www.novaderm.com > helpdesk@novaderm.com > 866-892-4149 > > > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ -- Will Starck NovaDerm Skincare Science http://www.novaderm.com helpdesk@novaderm.com 866-892-4149 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ WJ Starck

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 make this faster???? (2000) [Replace] really replaces? (2000) [OT] What log analyzer do you use? (2000) Severe Slowness (2005) [WebDNA] Deliminating encrypted values (2008) emailer w/F2 (1997) OT: Kerio Mail Server (2005) Email Formatting (1998) New WebDNA Forum Solution (in development) (2003) RE: Purchased cart being overwritten (1997) Re:Review comparison by PC Magazine: Open for On-line Business (1997) problems with 2 tags (1997) OT: OSX calculator error (2004) A multi-processor savvy WebCatalog? (1997) AppleScript: Tell application:app location? (1998) syntax question, not in online refernce (1997) [SearchString] usage (1997) Random search is not random (2002) Shownext! (1998) WebCatalog as a ListServ (1998)