cancel
Showing results for 
Search instead for 
Did you mean: 

Average

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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;

Former Member
0 Kudos

Thanks

Answers (0)