SP_DBSTATS

DBSTATS()

  Short:
  ------
  DBSTATS() Statistical report on dbf, including
  sum/avg/min/max/std/var/count

  Returns:
  --------
  Nothing

  Syntax:
  -------
  DBSTATS()

  Description:
  ------------
  This is a point & shoot metafunction which allows the
  user to get statistical data on a dbf, particularly with
  numeric fields.

  Statistics available are: count, sum, average,
  minimum, maximum, variance and standard deviation. the analysis
  may also be based on a conditional criteria.

  Examples:
  ---------
   use (cDbfName)

   DBSTATS()    // its a menu driven metafunction

  Source:
  -------
  S_DBSTAT.PRG

 

SP_AVARIANCE

AVARIANCE()

  Short:
  ------
  AVARIANCE() Determines the variance of an array with condition

  Returns:
  --------
  <nVariance> => Array variance

  Syntax:
  -------
  AVARIANCE(aTarget,[bCondition])

  Description:
  ------------
  <aTarget> is the target array. Normally an array of
  numeric values. [bCondition] is an optional codeblock used to
  select a subset of the array. This could be used to filter out
  0's or non-numeric elements. The block must accept an array
  element as a parameter, and return true or false <expL> to
  determine if this element is part of the desired subset.

  Examples:
  ---------
   v := AVARIANCE(aSales)
   v := AVARIANCE(aSales,{|e|valtype(e)=="N".and.e<>0})

  Source:
  -------
  S_ASTATS.PRG

 

SP_AMVARIANCE

AMVARIANCE()

  Short:
  ------
  AMVARIANCE() Variance on a given element of multi-dim array

  Returns:
  --------
  <nVariance> => average of array element

  Syntax:
  -------
  AMVARIANCE(aMult,nElem,[bCondition])

  Description:
  ------------
  Returns variance of array <aMult> element <nElem>.
  [bCondition] is an optional codeblock used to select a subset of
  the array. This could be used to filter out 0's or non-numeric
  elements. The block must accept a subarray as a parameter, and
  return  true or false <expL> to determine if this element is
  part of the desired subset. Please note that the codeblock
  accepts the whole subarray, not  just subarray element <nElem>

  Examples:
  ---------

   ?"Total file size here is "
   ??AMSUM(DIRECTORY(),2)

   ?"Total .EXE file size here is "
   ??AMSUM(DIRECTORY(),2,{|e|".EXE"$e[1]}  )

   ?"Variance:"
   ??AMVARIANCE(DIRECTORY(),2,{|e|".EXE"$e[1]}  )

  Notes:
  -------
  Coded by Matthew Maier.

  Presumes all sub-arrays are of equal length

  Source:
  -------
  S_AMSTAT.PRG