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

Re: Subtotal function



On Fri, Dec 03, 1999 at 08:44:25PM -0600, Darin Maxwell wrote:
> I'm looking into adding the subtotal functionality that exists in Excel's
> Data menu as it's one that I use often in my work, but I've noticed that the
> subtotal worksheet function in Gnumeric isn't working correctly. It doesn't
> handle nested subtotals correctly, and the subtotal function's whole reason
> for being is to nest. <grin>

You're correct.  This is a bug.  Please submit it to bugs.gnome.org.
 
> I've looked at the code and I think it'd take me a while to understand what
> it's trying to do. Anyone know anything about why this function isn't
> working in Gnumeric before I venture deeper into the code?

It is not working because we did not realize the full complexity of the
function.  Fixing it will be non-trivial for a couple of reasons.

1) Gnumeric uses std functional expression evaluation.  This function violates
that.  It requires that an expression know how a referenced value was computed.

2) I can't see a non-ambiguous way to implement what this function supposedly
offers.  Apparently neither did the XL people. 

ie in XL2000
    A1 : 10
    B1 : subtotal(9,A1)		= 10 ok
    B2 : subtotal(9,A1)		= 10 ok
    B3 : subtotal(9,B1:B2)	= 0 ???

The documentation is far from comprehensive.  It alludes to 2 type of
functionality that will need adjustments to the core to support.
    - ignoring nested subtotals.
    - ignoring hidden rows/cols. (when we support hiding)

However it does not explain how to handle nested subtotals of
different types
ie a subtotal(8, ???) that contains a subtotal(9, xxxx)

As a first step I'll make a request.  Can someone who has used this function
extensively and is familiar with XL implementation write a large detailed
comment (some documentation extensions wouldn't hurt either) detailing the
behavior in these cases ?  (Darin maybe ??)

Once we have a complete description of what its supposed to do we can discuss
how to extend Gnumeric to allow for implementation.

Thanks




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