[rules-users] Fusion: Group By

Andreas Bauer brm1 at gmx.net
Mon Jun 7 17:56:41 EDT 2010


Hi,

I was wondering how you can achieve a "group by" like this

select tickDataFeed, stddev(price)
from StockTickEvent(symbol='IBM').win:length(10) 
where volume > 1000
group by tickDataFeed 
having stddev(price) > 0.8

I thought of using accumulate or collect, but I'm not sure of the exact syntax. What I tried up to now

rule "test"
when
    $event : CountEvent() over window:time( 15s ) from entry-point "Stream"
   $grouped : Integer() from accumulate (CountEvent($c1:count), count($c1)) 
then ...

But that doesn't work. Any hints?

Best regards,

Andi


-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl



More information about the rules-users mailing list