Your example is basically right, here is a complete working example:

var data = stream
    |from()
        .measurement('m')
        .groupBy('a', 'b', 'c')
    |window()
        .period(10s)
        .every(10s)
    |top(3, 'field')
    |sum('top')
    |alert()
        .crit(lambda: "sum" == 0)


You need to window the data to define over how much time you want to find 
the top values. Adjust the period and every durations to your needs.



On Tuesday, August 9, 2016 at 3:00:41 AM UTC-6, [email protected] 
wrote:
>
> i want to find the sum of top 3 values from the stream of data, how can it 
> be done?
>
> i am looking something like,
>
> var data = stream
>                 |from()
>                   .measurement('measurement1')
>                   .groupBy('a','b','c')
>                 |top(3,"field")
>                 |sum("field")
>
> and i would like to rais ean alert if (data==0)
>
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/3f05391e-e4b1-453a-99c2-ed8f114ea593%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to