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:

PSC recommends what date format yr 2000??? (1997) Off Topic: Frames Killer? (1998) Shopping Carts (2000) [WebDNA] why is the webdna.us site slow? (sometimes?) (2011) Merging databases (1997) japanese characters (1997) Sorting Dates (2000) Fun with dates (1997) So Simple (2005) WebCat2b15MacPlugin - [protect] (1997) WebMerch/Emailer Error (1998) Updating fields from different platforms (1998) Alternating BGColors in Table Rows (1998) thankyou.tmpl (1997) NetCloak as Emailer substitute? (1999) Shop till you drop dead on the avenue ... (1997) Store Builder, technical infos (1998) Re:quit command on NT (1997) Problem (1997) remotely add + sign (1997)