summaryrefslogtreecommitdiff
path: root/calc.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-07-02 13:43:31 +0800
committerxuri <xuri.me@gmail.com>2022-07-02 13:43:31 +0800
commit695db4eae06fdc2a049fc50f61e6a60f83013290 (patch)
tree014ee8c90e6b4fb9fe5bd1122a22a250c576fb64 /calc.go
parenta77d38f04059d4febd2aba8b5656a826af51d9e7 (diff)
ref #65, new formula functions: DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, and DVARP
Diffstat (limited to 'calc.go')
-rw-r--r--calc.go82
1 files changed, 82 insertions, 0 deletions
diff --git a/calc.go b/calc.go
index 8476f8d..25c2e18 100644
--- a/calc.go
+++ b/calc.go
@@ -438,7 +438,13 @@ type formulaFuncs struct {
// DMIN
// DOLLARDE
// DOLLARFR
+// DPRODUCT
+// DSTDEV
+// DSTDEVP
+// DSUM
// DURATION
+// DVAR
+// DVARP
// EFFECT
// EDATE
// ENCODEURL
@@ -18090,6 +18096,18 @@ func (fn *formulaFuncs) database(name string, argsList *list.List) formulaArg {
return fn.MAX(args)
case "DMIN":
return fn.MIN(args)
+ case "DPRODUCT":
+ return fn.PRODUCT(args)
+ case "DSTDEV":
+ return fn.STDEV(args)
+ case "DSTDEVP":
+ return fn.STDEVP(args)
+ case "DSUM":
+ return fn.SUM(args)
+ case "DVAR":
+ return fn.VAR(args)
+ case "DVARP":
+ return fn.VARP(args)
default:
return fn.AVERAGE(args)
}
@@ -18176,3 +18194,67 @@ func (fn *formulaFuncs) DMAX(argsList *list.List) formulaArg {
func (fn *formulaFuncs) DMIN(argsList *list.List) formulaArg {
return fn.database("DMIN", argsList)
}
+
+// DPRODUCT function calculates the product of a field (column) in a database
+// for selected records, that satisfy user-specified criteria. The syntax of
+// the function is:
+//
+// DPRODUCT(database,field,criteria)
+//
+func (fn *formulaFuncs) DPRODUCT(argsList *list.List) formulaArg {
+ return fn.database("DPRODUCT", argsList)
+}
+
+// DSTDEV function calculates the sample standard deviation of a field
+// (column) in a database for selected records only. The records to be
+// included in the calculation are defined by a set of one or more
+// user-specified criteria. The syntax of the function is:
+//
+// DSTDEV(database,field,criteria)
+//
+func (fn *formulaFuncs) DSTDEV(argsList *list.List) formulaArg {
+ return fn.database("DSTDEV", argsList)
+}
+
+// DSTDEVP function calculates the standard deviation of a field (column) in a
+// database for selected records only. The records to be included in the
+// calculation are defined by a set of one or more user-specified criteria.
+// The syntax of the function is:
+//
+// DSTDEVP(database,field,criteria)
+//
+func (fn *formulaFuncs) DSTDEVP(argsList *list.List) formulaArg {
+ return fn.database("DSTDEVP", argsList)
+}
+
+// DSUM function calculates the sum of a field (column) in a database for
+// selected records, that satisfy user-specified criteria. The syntax of the
+// function is:
+//
+// DSUM(database,field,criteria)
+//
+func (fn *formulaFuncs) DSUM(argsList *list.List) formulaArg {
+ return fn.database("DSUM", argsList)
+}
+
+// DVAR function calculates the sample variance of a field (column) in a
+// database for selected records only. The records to be included in the
+// calculation are defined by a set of one or more user-specified criteria.
+// The syntax of the function is:
+//
+// DVAR(database,field,criteria)
+//
+func (fn *formulaFuncs) DVAR(argsList *list.List) formulaArg {
+ return fn.database("DVAR", argsList)
+}
+
+// DVARP function calculates the variance (for an entire population), of the
+// values in a field (column) in a database for selected records only. The
+// records to be included in the calculation are defined by a set of one or
+// more user-specified criteria. The syntax of the function is:
+//
+// DVARP(database,field,criteria)
+//
+func (fn *formulaFuncs) DVARP(argsList *list.List) formulaArg {
+ return fn.database("DVARP", argsList)
+}