Developing Apama Applications > Developing Apama Applications in EPL > Working with Streams and Stream Queries > Defining stream queries > Adding window definitions to from and join clauses > Using multiple partition by expressions
Using multiple partition by expressions
To partition a window according to multiple criteria, you can insert multiple, comma-separated expressions. For example, you can refine a previous query to produce values for different volume bands, as follows:
from t in all Tick()
   partition by t.symbol, t.volume.floor()/100 retain 1
   select rstream t;
In this example, the correlator applies retain 1 to each set of ticks that share both the same symbol and the same volume (to within 100). As a result, an item is output only when a replacement tick arrives for an existing symbol in an existing volume band.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.