Re: [WebDNA] sum in a search

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103754
interpreted = N
texte =
There is no particular context for this. Use [math] to add things up along the way. Above the fo= unditems loop, open up variables like so:

[math show=3Df]runningtotal=3D0[/math]
[math show=3Df]= ]runningquantity=3D0[/math]

Then in the founditems loop,= =A0
[math show=3D= f]runningtotal=3Drunningtotal+[amt][/math] (or whatever fieldname holds the amount)
[math show=3D= f]runningquantity=3Drunningquantity+[qty][/math]=A0(or whatever fieldname holds the quantity)

In math, you don't have to = bracket the fieldname, but if you prefer to do so, feel free; it will work that way as well.
At the end, just display [runningtotal] and [runningquanti= ty]
By the way, = this is also a handy way to get a more accurate numfound if you are using [hideif] anywhere in the founditems to exclude = results. Sometimes you need to do it that way instead of excluding in the search parameters.
<= br class=3D"webkit-block-placeholder">
Terry

On Wed, 7 Oct 2009 10:5= 1:10 -0700
Tana Adams <tana@volleyhut.com> wrote:
> I know there's a way to calcula= te the sum and quantities
>within [founditems]
> but I can't seem to locate it in the online referenc= e.
> Could someone please
> point me in the right direction?
>
> Thanks,
>
> Tana=

=A0
Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] sum in a search (Stuart Tremain 2009)
  2. Re: [WebDNA] sum in a search ("Terry Wilson" 2009)
  3. Re: [WebDNA] sum in a search (Govinda 2009)
  4. Re: [WebDNA] sum in a search (Tana Adams 2009)
  5. Re: [WebDNA] sum in a search (Brian Fries 2009)
  6. Re: [WebDNA] sum in a search (Tana Adams 2009)
  7. Re: [WebDNA] sum in a search (Tana Adams 2009)
  8. Re: [WebDNA] sum in a search (Dan Strong 2009)
  9. Re: [WebDNA] sum in a search (Kenneth Grome 2009)
  10. Re: [WebDNA] sum in a search ("Terry Wilson" 2009)
  11. [WebDNA] sum in a search (Tana Adams 2009)
There is no particular context for this. Use [math] to add things up along the way. Above the fo= unditems loop, open up variables like so:

[math show=3Df]runningtotal=3D0[/math]
[math show=3Df]= ]runningquantity=3D0[/math]

Then in the founditems loop,= =A0
[math show=3D= f]runningtotal=3Drunningtotal+[amt][/math] (or whatever fieldname holds the amount)
[math show=3D= f]runningquantity=3Drunningquantity+[qty][/math]=A0(or whatever fieldname holds the quantity)

In math, you don't have to = bracket the fieldname, but if you prefer to do so, feel free; it will work that way as well.
At the end, just display [runningtotal] and [runningquanti= ty]
By the way, = this is also a handy way to get a more accurate numfound if you are using [hideif] anywhere in the founditems to exclude = results. Sometimes you need to do it that way instead of excluding in the search parameters.
<= br class=3D"webkit-block-placeholder">
Terry

On Wed, 7 Oct 2009 10:5= 1:10 -0700
Tana Adams <tana@volleyhut.com> wrote:
> I know there's a way to calcula= te the sum and quantities
>within [founditems]
> but I can't seem to locate it in the online referenc= e.
> Could someone please
> point me in the right direction?
>
> Thanks,
>
> Tana=

=A0
"Terry Wilson"

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:

WebMerchant 1.6 and SHTML (1997) NT beta ReadMe missing (b12-b15) (1997) New Mac Public Beta Available (1997) OT Domain Management (2003) [WebDNA] Question on table search (2011) Quit revisited (1997) Searching for (field1 OR field2) AND field3 (2000) WebCat2.0 acgi vs plugin (1997) WebDNA 5.0 Enterprise Edition (2003) WebCatalog NT (1996) RE: Credit card processing - UK (1997) Emailer setup (1997) Emailing html (1998) MacActivity and PCS (1997) WC2b12: Yes, Formulas.db is for real (1997) [WebDNA] directory protection questions (2008) Emailer setup (1997) Scoping rules in WebDNA 4.0 (2000) [WebDNA] [OT] WebDNA Wiki - need grammar check / suggestions (2009) Sending & and other chars thru an append context (2002)