Help Files
Aggregating

Weekly

wagg (expr [, type] [, startday] [, reportday] [,endday])

parameters

  1. expr:

    Stream of data to be aggregated

  2. type:

    Aggregation type.

    values:
    avg, average
    last
    first
    low
    high
    mid - midpoint between high and low
    sum

    default: avg

  3. startday:

    Week day to be used as a first day of aggregation period within a week.

    values:
    su, sun, sunday
    mo, mon, monday
    tu, tue, tuesday
    we, wed, wednesday
    th, thu, thursday
    fr, fri, friday
    sa, sat, saturday

    default: sun

  4. reportday:

    Week day to be used to tag the aggregated values.

    values: see startday.

    default: startday

  5. endday:

    Week day to be used as a last day of aggregation period within a week.

    values: see startday.

    default: 6th day after startday

examples

wagg("/GCL[0]")
wagg("/GCL[0]", high, mon, tue)
wagg("/GCL[0]", type:high, startday:mon, reportday:tue)
wagg( ("/GCL[0]" + "/GCL[1]") / 2 )
wagg("/GCL[0]", mid, fri, mon)
wagg("/GCL[0]", type:mid, startday:fri, reportday:mon)
wagg("/GCL[0]", type:high, startday:mon, endday:fri, reportday:mon)

named parameters

Monthly

magg (expr [, type] [, startday] [, reportday] [, endday] [, startoffset] [, reportoffset])

parameters

  1. expr:

    Stream of data to be aggregated

  2. type:

    Aggregation type.

    values: see wagg function.

    default: avg

  3. startday:

    Day of month to be used as a start point of aggregation.

    values: 1..31

    default: 1

  4. reportday:

    Day of month to be used to tag the aggregated values.

    values: 1..31

    default: startday

  5. endday:

    Day of month to be used as a end point of aggregation.

    values: 1..31

    default: startday-1 of next month

  6. startoffset:

    Month offset for shifting startday number of months forward or backward.

    values: positive or negative integer numbers depending on shift direction

    default: 0

  7. reportoffset:

    Month offset to shift reportday number of months forward or backward

    values: see startoffset

    default: 0

examples

magg("/GCL[0]")
magg("/GCL[0]", avg, 15, 31, -1, 1)
magg("/GCL[0]", type:mid, reportday:10)

Quarterly

qagg (expr [, type] [, startday] [, reportday] [, endday] [, startoffset] [, reportoffset])

parameters

(see magg function)

examples

qagg("/GCL[0]")

Yearly

yagg (expr [, type] [, startday] [, reportday] [, endday] [, startoffset] [, reportoffset])

parameters

(see magg function)

examples

yagg("/GCL[0]")

Contract

cagg(expr [, type])

parameters

  1. expr:

    Stream of data to be aggregated

  2. type:

    Aggregation type.

    values: see wagg function.

    default: avg

examples

cagg("/GCL", type:mid)

Parameters in aggregation functions can be specified in the order of their appearance in function declaration. Optional parameters can be omitted, and can be specified out of order using named parameter form, e.g.:

wagg("/GCL[0]", startday: mon, endday: fri, reportday: fri)
magg("/GCL[0]", startday:15, reportday: 1, reportoffset: 1)