[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [PATCH] New function for KSpread: SUMIF()
From:       Tomas Mecir <mecirt () gmail ! com>
Date:       2004-08-23 12:45:19
Message-ID: 492258b104082305451a6d7705 () mail ! gmail ! com
[Download RAW message or body]

Greetings!

On Sat, 14 Aug 2004 12:29:54 +0000, Bram Schoenmakers
<bramschoenmakers@kde.nl> wrote:
> This patch implements the SUMIF()-function, which sums all values matching a
> criteria. I've split the patch up to two parts:
> 
> diff1 --- A preparation. It moves some criteria-related code from
> kspread_functions_database.cc to kspread_functions_helpers.cc, so all
> function can benefit of using criterias. Currently, COUNTIF() only supports
> the relation 'equals to', but because it can access the match-methods now, it
> supports all kind of operators.
> I'll have a look if there are more functions which could use this.

Hm, maybe. But I believe that things like this would be better
implemented as array formulas, which can do all this and more :D

> Remains only one question:
> I don't get the KSValue-structure when a range-argument is supplied. It seems
> there are lists-in-lists, but I don't know why. If the range A1:A2 (with 2
> doubles) is selected, the two values are stored like
> 
> <List>
>   <List>
>     <Double>
>   </List>
>   <List>
>     <Double>
>   </List>
> </List>
> 
> Why is there a single-entry list inside the main list?

Hm, not 100% sure here, but I think that's rows and columns, A1:A2 has
2 rows, with 1 value in each. Hence, your implementation may fail if
you give it something that has more than one column - haven's tested
that yet, so please have a look what will your function do if you give
it a row or some arbitrary range...

/ Tomas
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic