Use Variables in Aggregate Functions (not just fields)

Idea created by beverly Expert on May 5, 2017


    Aggregate functions

    Note  Aggregate functions perform statistical analysis on numbers (and dates or times for some functions) in:

    • several fields in a record.
    • related fields whether displayed in a portal or not.
    • repeating fields



    change the "field(s)" to "field(s) or variable(s)"



    There are many times that the built-in aggregate functions do the job, but only when the data is in a field. This idea may be prohibitive, but if so, please reply with a why!


    List() is considered an 'aggregate' and allows variables:

    field - any related field, repeating field, or set of non-repeating fields; an expression that returns a field, repeating field, or set of non-repeating fields, or a variable.

    So? allow the other aggregates use variables!



    Let (

        [ _mylist = List ( 1 ; 2 ; 3 ; 4 )

        ; _return = Average ( _mylist )

        ]; _return

        ) // ERROR: <Field Missing>

    Why not?

    Yes, there are custom functions. Yes, there are ways to use external (i.e. Javascript). Yes, there are plug-ins.


    Just posting an idea.