Re: SOLUTION? Re: Me know logical no need

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 41366
interpreted = N
texte = 15,000 math variables? Not possible. WebDNA is limited to 150 math variables (see docs). You could possibly do this with text variables, but WebDNA gets really slow searching through tons of variables, especially when their names are long.My approach would probably be to search the finished database for SOLD properties, sorting by agent ID, totaling sales and writing to an agent database once for each agent, kinda like this:[text]curAgent=[/text] [math show=F]curTotal=0[/text] [search db=...&eqSTATUSdata=SOLD&allhit=1&asAGENTIDsort=1][founditems] [showif [url][AGENTID][/url]![url][curAgent][/url]] [showif [url][curAgent][/url]!] [append db=AGENT.db]AGENTID=[curAgent]&TOTAL=[curTotal][/append] [/showif] [text]curAgent=[AGENTID][/text] [math show=F]curTotal=0[/math] [/showif] [math show=F]curTotal=[curTotal]+[SALEPRICE][/math] [/founditems][/search]- brianAt 10:10 AM 7/10/02, Joseph D'Andrea wrote: >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 >____________________________________________________________-- <= Brian C. Fries, BrainScan Software http://www.brainscansoftware.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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
15,000 math variables? Not possible. WebDNA is limited to 150 math variables (see docs). You could possibly do this with text variables, but WebDNA gets really slow searching through tons of variables, especially when their names are long.My approach would probably be to search the finished database for SOLD properties, sorting by agent ID, totaling sales and writing to an agent database once for each agent, kinda like this:[text]curAgent=[/text] [math show=F]curTotal=0[/text] [search db=...&eqSTATUSdata=SOLD&allhit=1&asAGENTIDsort=1][founditems] [showif [url][AGENTID][/url]![url][curAgent][/url]] [showif [url][curAgent][/url]!] [append db=AGENT.db]AGENTID=[curAgent]&TOTAL=[curTotal][/append] [/showif] [text]curAgent=[AGENTID][/text] [math show=F]curTotal=0[/math] [/showif] [math show=F]curTotal=[curTotal]+[SALEPRICE][/math] [/founditems][/search]- brianAt 10:10 AM 7/10/02, Joseph D'Andrea wrote: >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 >____________________________________________________________-- <= Brian C. Fries, BrainScan Software http://www.brainscansoftware.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://search.smithmicro.com/ Brian Fries

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:

RAM variables (1997) security (1997) [WebDNA] triggers.db "next execute" fails to update (2012) Email within tmpl ? (1997) PCS Frames (1997) Bad Code Contest (2007) Fwd: Problems with Webcatalog Plug-in (1997) Sandboxes (2004) Help! WebCat2 bug (1997) [date format] w/in sendmail (1997) Bug Report, maybe (1997) New Site Announcement (1998) [dos] command and [math] (1998) Re:listfiles-looking for slick solution (1997) What am I missing (1997) [append] vs. [appendfile] delta + question? (1997) details (2003) Webcat2, WebCommerce, Mod 10 etc. (1997) Caching [include] files ... (1997) OT OSX Login Problem (2006)