Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Statistical functions in VFP6 (import)
Message
De
01/11/2000 13:39:12
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00435549
Message ID:
00436796
Vues:
24
Nadya:

Sorry for not being precise: performance is about the same if you have to build the index. GetMedian is MUCH faster if the index already exists. I played a little bit with your functions and I came up with a few things.

Note 1
------
In GetMediam, you have to change one line from
lnMedianValue=evaluate(lcTableName + '.' + pcField)
to
lnMedianValue=evaluate(lcCursor + '.' + pcField)
in order to work.

Note 2
------
In GetMedianValue, you should have two distict SELECT SQL statements:
One with the WHERE clause and one without. This will increase performance if tcWhere is empty.

Note 3
------
GetMedian cannot have an equivalent FILTER clause because its logic breaks down if one record is filtered out (including current filter) or if a record is deleted.


I personnally stay away from stuff like GetMedian because it requires some housekeeping code. I tend to write stuff in SQL because I find it much easier to debug and maintain.

My .02 worth,

Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform