Math Functions

List GetTimeSeries(List data, String dateField, String valueField, DateTime startDate, DateTime endDate, String increment, String aggr)
Returns time series list for date-based data in the given list (data), using the given dateField, valueField, between startDate and endDate.

List MakeNumList(Number start, Number end, Number steps)
Returns a list of numbers from start to end, skipping steps on each iteration.

Number ProrateToEndOfMonth(Number amount, Any date)
Prorates the given number (per month) from the given date to the end of the month.

Number GetNumber(Any expr)
Converts the given value into a number.

String FormatNumber(Any expr, String format)
Formats the given number value using the given standard number format string.

String FormatDouble(Any expr, String format)
Formats the given number value using the given standard number format string.

Number Round(Any expr)
Rounds the given number value to the nearest whole number.

Number RoundTo(Any expr, Number decPlaces)
Rounds the given number value to the nearest number of decimal places.

Number Random(Number min, Number max, Number decPlaces)
Returns a random nuber between min and max, rounded to decimal places.

Record math:GetStandardDeviationTS(List list, String dateField, String valueField)
Returns the standard deviation from the given list, with dateField holding the date and valueField holding the number.

Number math:Pow(Number val, Number exp)
Returns value raised to the power of exp.

Number math:Abs(Number val)
Returns the absolute value (removing the sign) of val.

Number math:Mod(Number val, Number mod)
Returns val moduluo mod of the given number.

Number math:XIRR(List cashFlows)
Calculates the internal rate of return (IRR) of the given cashflows. List must contain records containing Value and Date fields.

Number Trunc(Any expr)
Truncates the given numeric value, removing any fractions (not rounding).

Number Double(Any expr)
Converts the given string expression to a number.

Number Sum(Path path)
Sums the values of the records in the database pointed to by path, with the last item of the path being the field to sum.

Any Max(Any expr)
Returns the max of the values of the records pointed to by path, with the last item of the path being the field to use.

Any Min(Any expr)
Returns the minimum of the values of the records pointed to by path, with the last item of the path being the field to use.

Number Average(Any expr)
Returns the average of the values of the records pointed to by path, with the last item of the path being the field to use.

Number SumField(RecordOrList seq, String field)
Performs a sum on the value of field in the ilst of records in seq. Suitable for use in lists that aren't yet committed to the database.

List Group(List seq, String key, String aggregateFunc, String aggregateFields)
Groups the given list (seq) by the given key. Performs the aggregate function (must be "SUM" at present) on the given aggregate fields, which must be forward-slash separated.


Next Topic:
v4.2.0.956 (beta)
Up Since 2/29/2024 12:02:23 AM