qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] problems aggregating with sum()


From: Per Bothner
Subject: Re: [Qexo-general] problems aggregating with sum()
Date: Thu, 27 Oct 2005 10:05:13 -0700
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

Kevin Y. Kim (Lists) wrote:
Interesting.  I also tried AVG() and that seem to work.  I would
assume that AVG() and SUM() would have to do the same conversion
at some point.

They should - but don't.  'avg' is "hand-conded" and includes
explicit calls to numberValue.  'sum' is implemented using the
general Reduce mechanism, and so doesn't.


As a work-around try:
  sum(for $none in $recs/value/text() return number($node))


I assume that should read:
    sum(for $node in $recs/value/text() return number($node))

Yes.
--
        --Per Bothner
address@hidden   http://per.bothner.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]