Re: Getting Averages for online form.

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23065
interpreted = N
texte = >The results are recorded to a db as follows. > >UISPEED >11 >54 > >I would like to (on a webcat page) add up all the results of each >field and then divide it by the number of responses, so as to get an >average number. In this case, the UI average would be 3. How can I >use the [search] and [math] tags to do this?[Search db=yourdbname.db&neUIdata=[blank]] [MATH SHOW=F]TotalVotes=[NumFound][/MATH] [MATH SHOW=F]TotalUI=0[/MATH] [MATH SHOW=F]TotalSpeed=0[/MATH] [FoundItems] [MATH SHOW=F]TotalUI=TotalUI+[UI][/MATH] [MATH SHOW=F]TotalSpeed=TotalSpeed+[SPEED][/MATH] [/FoundItems] [/Search]Results: Total Votes: [MATH]TotalVotes[/MATH] UI Average: [MATH]TotalUI/TotalVotes[/MATH] Speed Average: [MATH]TotalSpeed/TotalVotes[/MATH]Use [Format] if you want to round the calculated averages. ************************************************************* Christer Olsson Stora Nygatan 21 Phone +46 40 791 50 Ljusa Ideer AB S-211 37 Malmoe Fax +46 40 97 99 77 Sweden http://www.ljusaideer.se Associated Messages, from the most recent to the oldest:

    
  1. Re: Getting Averages for online form. (Christer Olsson 1999)
  2. Getting Averages for online form. (Kevin Furuta 1999)
>The results are recorded to a db as follows. > >UISPEED >11 >54 > >I would like to (on a webcat page) add up all the results of each >field and then divide it by the number of responses, so as to get an >average number. In this case, the UI average would be 3. How can I >use the [search] and [math] tags to do this?[Search db=yourdbname.db&neUIdata=[blank]] [MATH SHOW=F]TotalVotes=[NumFound][/MATH] [MATH SHOW=F]TotalUI=0[/MATH] [MATH SHOW=F]TotalSpeed=0[/MATH] [founditems] [MATH SHOW=F]TotalUI=TotalUI+[UI][/MATH] [MATH SHOW=F]TotalSpeed=TotalSpeed+[SPEED][/MATH] [/FoundItems] [/Search]Results: Total Votes: [math]TotalVotes[/MATH] UI Average: [math]TotalUI/TotalVotes[/MATH] Speed Average: [math]TotalSpeed/TotalVotes[/MATH]Use [format] if you want to round the calculated averages. ************************************************************* Christer Olsson Stora Nygatan 21 Phone +46 40 791 50 Ljusa Ideer AB S-211 37 Malmoe Fax +46 40 97 99 77 Sweden http://www.ljusaideer.se Christer Olsson

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:

docs for WebCatalog2 (1997) Newbie questions (1999) WebCommerce: Folder organization ? (1997) question: webdelivery folder and file (1997) Upgrading old WebCat Database Files (1997) Using Eudora instead of Emailer, and cron facility (1998) RAM variables (1997) [WebDNA] Webdna 6.2 on OSX 10.10 (2017) [OT] Certs (2002) Bad Cookie / Internet Option / Internet Explorer (2004) Claris HomePage messes up the code (1997) .. more on sliding discounts... (1997) Showif for mulitple variations (1997) Maybe OT - MS Server2003 issues with webdna (2005) Weird problems with [SHOWIF]s (1997) searching numbers (1998) NT b19 sends extra MIME headers (1997) WebDNA for Dummies (was: WebDNA portability) (2007) $Quit, $CloseDatabase corrections (1997) WebCatalog [FoundItems] Problem - LONG - (1997)