Skip to main content

QueryComputedAggregate

@gravity-rail/sdk


@gravity-rail/sdk / QueryComputedAggregate

Interface: QueryComputedAggregate

A named per-member aggregate (member queries only). The fields of QueryAggregatePredicate that say what is aggregated, validated by the same rules, plus an alias that sort and select reference as computed.<alias>. A member with no rows reads 0 for count/sum and null for max, which sorts last in either direction.

Properties​

alias​

alias: string


metric?​

optional metric: "count" | "max" | "sum"


of?​

optional of: string | null

sum only: the numeric record field to total (record.<slug>).


period?​

optional period: QueryAggregatePeriod | null

sum only: the calendar month the records must fall in.


periodField?​

optional periodField: string | null

sum only: the record date field the calendar month is read from.


source​

source: string


sourceIds?​

optional sourceIds: number[] | null


windowDays?​

optional windowDays: number | null


windowHours?​

optional windowHours: number | null

Mutually exclusive with windowDays.