Re: Summing results of a nested search
This WebDNA talk-list message is from 2006
It keeps the original formatting.
numero = 67883
interpreted = N
texte = 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 StarckNovaDerm Skincare Sciencehttp://www.novaderm.comhelpdesk@novaderm.com866-892-4149On 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 Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
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 StarckNovaDerm Skincare Sciencehttp://www.novaderm.comhelpdesk@novaderm.com866-892-4149On 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 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:
Attention all list readers (1997)
Record size (1998)
More questions about serial number dishing (1997)
[WebDNA] payment processor for Hong Kong bank (2015)
WebCatalog Use Question (1997)
Sherlock and WebCat (1998)
Securing/hiding database file (2000)
[WebDNA] WebDNA 7 (2011)
php + WebCatalog in same files (2001)
The Classifieds template set (2003)
A little help on e-mail (HELP!!! :-) ) (1998)
WebCatalog and WebMerchant reviewed by InfoWorld (1997)
[shell] oddity (2002)
Something wrong with this list? (2006)
webcat- multiple selection in input field (1997)
[WebDNA] HTTP crashes (2010)
oops private message leaked into talk list (1997)
[shownext max=?] armed (1997)
[WebDNA] Help with iTools 9/WebDNA setup MacTel (2009)
Getting total number of items ordered (1997)