on 04-24-2015 10:40 AM
Hi,
I am using a Window which keeps 5 rows with one field called 'Value".
Is there a way I can take the average of these five values and pass it to the next stream?
Regards,
Suresh
You can just aggregate by a dummy constant to group all the rows. For example
CREATE INPUT WINDOW In1 SCHEMA (Value integer) PRIMARY KEY (Value) KEEP ALL;
CREATE OUTPUT WINDOW Avg
PRIMARY KEY DEDUCED
KEEP ALL
AS SELECT 1 DummyKey, avg(In1.Value) AvgVal FROM In1 GROUP BY 1;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.