SOLUTION? Re: Me know logical no need

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 41364
interpreted = N
texte = At 1:18 AM 7/10/02, Michael Davis wrote: >The solution is simple, if you get the database every day, then you >must have a process that you perform to import the database. During >this process, add a process whereby you distill a second database >that will be used for your live seller bragging rights >calculations. Basically, this second database will be two fields >wide, Agent, and Total. At 15,000 agents, this should be a pretty >responsive query. Do all the time consumptive searches and >calculations just once, when the second db is generated. Logically, >since you are only updating a static database once per day, you >should only have to do the complex stuff once per day.What do the agent ID's look like? I have to assume they are unique, and let's assume that they are less then 14 characters in length. If you buy that assumption, then let's pick up on Michael's idea. During the download/convert process (you already said you had to do one to change fireplaces and such...) use an array to calculate the agent's total. At the end of the run, dump the array out to a second database.[!] begin pseduo code (not real... may have errors [/!][!] first search the incoming db to get a list all the agentID's [/!] [search db=incomingfile&neAGENTIDdate=find_all&summ=t] [founditems] [!] should only be ~15,000 [/!] [math show=f]t[AGENTID]=[/math] [!] create an array and zero it out for each agent [/!] [replace db=agents.db&eqAGENTIDdata=[AGENTID]&append=T]AGENTID=[AGENTID][/replace] [/founditems] [/search][!] now do your regular processing on the incoming db [/!] [!] for each record in the incoming file [/!] [search.....] [founditems] -change fireplace data (for example) -fix space paddings -whatever -write out new listing record to live db [!] now calculate a total for the agent's sales [/!] [math show=f]t[agentID]=[interpret]t[agentID][/interpret]+[price][/math] [/founditems] [/search] [!] after processing all incoming records, [/!] [search agents.db&neAGENTIDdata=find_all] [founditems] [replace agents.db&eqAGENTIDdata=[AGENTID]]agenttotal=[interpret][t[AGENTID]][/interpret][/replace] [/founditems] [/search] Then to find the top 20 selling agents:[search agents.db&neAGENTIDdata=find_all&deAGENTTOTALsort=1&AGENTTOTALtype=num&max=20]Enjoy!-- ____________________________________________________________ Joseph D'Andrea ~ http://www.west21.com/ ~ JoeDan@West21.com WEST21.com Internet services for the 21st Century webhosting ~ co-location ~ wireless access WebCat and MGI database programming ____________________________________________________________------------------------------------------------------------- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
At 1:18 AM 7/10/02, Michael Davis wrote: >The solution is simple, if you get the database every day, then you >must have a process that you perform to import the database. During >this process, add a process whereby you distill a second database >that will be used for your live seller bragging rights >calculations. Basically, this second database will be two fields >wide, Agent, and Total. At 15,000 agents, this should be a pretty >responsive query. Do all the time consumptive searches and >calculations just once, when the second db is generated. Logically, >since you are only updating a static database once per day, you >should only have to do the complex stuff once per day.What do the agent ID's look like? I have to assume they are unique, and let's assume that they are less then 14 characters in length. If you buy that assumption, then let's pick up on Michael's idea. During the download/convert process (you already said you had to do one to change fireplaces and such...) use an array to calculate the agent's total. At the end of the run, dump the array out to a second database.[!] begin pseduo code (not real... may have errors [/!][!] first search the incoming db to get a list all the agentID's [/!] [search db=incomingfile&neAGENTIDdate=find_all&summ=t] [founditems] [!] should only be ~15,000 [/!] [math show=f]t[AGENTID]=[/math] [!] create an array and zero it out for each agent [/!] [replace db=agents.db&eqAGENTIDdata=[AGENTID]&append=T]AGENTID=[AGENTID][/replace] [/founditems] [/search][!] now do your regular processing on the incoming db [/!] [!] for each record in the incoming file [/!] [search.....] [founditems] -change fireplace data (for example) -fix space paddings -whatever -write out new listing record to live db [!] now calculate a total for the agent's sales [/!] [math show=f]t[agentID]=[interpret]t[agentID][/interpret]+[price][/math] [/founditems] [/search] [!] after processing all incoming records, [/!] [search agents.db&neAGENTIDdata=find_all] [founditems] [replace agents.db&eqAGENTIDdata=[AGENTID]]agenttotal=[interpret][t[AGENTID]][/interpret][/replace] [/founditems] [/search] Then to find the top 20 selling agents:[search agents.db&neAGENTIDdata=find_all&deAGENTTOTALsort=1&AGENTTOTALtype=num&max=20]Enjoy!-- ____________________________________________________________ Joseph D'Andrea ~ http://www.west21.com/ ~ JoeDan@West21.com WEST21.com Internet services for the 21st Century webhosting ~ co-location ~ wireless access WebCat and MGI database programming ____________________________________________________________------------------------------------------------------------- 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://search.smithmicro.com/ Joseph D'Andrea

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:

.. more on sliding discounts... (1997) How to implement 'email to a friend' feature? (2002) oops private message leaked into talk list (1997) LIstFiles - filnames are cart numbers. (2000) Looking for WebCatalog Programmer in Silicon Valley (1998) wired [protect] action? (1998) 2nd WebCatalog2 Feature Request (1996) [OT] Bulk Email Software (2002) Summing fields (1997) Nested vs conditional (1997) Re:What file? (1997) RE: [WebDNA] OT - JS help (2008) WC2b15 File Corruption (1997) List archive status? (1999) instant cookies? (1999) Add message to Order (1997) WebDNA Verison 4.5 (2002) PSC recommends what date format yr 2000??? (1997) Sorting by SKU Not Working (1998) Multiple Merchant Accounts? (1997)