Contents:
=20The row from which to extract a value is determined by the order in =
which the rows are organized based on the order
parameter.&nbs=
p;
If you are working on a randomly generated sample of your datas= et, the values that you see for this function might not correspond to the v= alues that are generated on the full dataset during job execution.
1000
values. =
To change the maximum number of values, specify a value for the =
limit
parameter.1 and 0
, which computes the rolling function from the=
current row back to the first row of the dataset.
 This function works with the Window transform. See Window Transform.=
For more information on a nonrolling version of this function, see =
;LIST Function.
Wrangle vs. SQL: This function is part of Wrangle , a proprietary data transformation language.=
Wrangle is not SQL. For more information, se=
e Wrangle Language.
Basic Usa=
ge
Column example:
=20
rollinglist(myCol)
Ou=
tput: Returns the rolling list of values in the myCol
column from the first row =
of the dataset to the current one.
Rows before example:
=20
rollinglist(myNumber, 5, 20)
Ou=
tput: Returns the rolling list of values of the current row and th=
e twenty previous row values in the =
myNumber
column, with a limit of 5 total values.
Rows before and after example:
=20
rollinglist(myNumber, 20, 299, 200)=
Output: Returns the rolling list of values from the previous 299 rows, the curren=
t row value, and the 200 rows after the current one in the myNum=
ber
column, with a limit of 20 total values. =
=
Syntax and Arguments
=20
rollinglist(col_ref, rowsBefore_integer, r=
owsAfter_integer) order: order_col [group: group_col]
=20
=20
=20
=20
=20
Argument
Required?
Data Type
Description
col_ref
Y
string
Name of column whose values are applied to the f=
unction
limit_int
N
integer
Maximum number of values to extrac=
t into the list array. From 1
to 1000.
rowsBefore_integer
N
integer
Number of rows before the current one to include=
in the computation
rowsAfter_integer
N
integer
Number of rows after the current one to include =
in the computation
For more information on the order
and =
group
parameters, see Window Transform.
For more information on syntax standards, see Language Documentation Syntax Note=
s.
col_ref
Name of the column whose values are used to compute the function. <=
/p>
 Multiple columns and wildcards are not supported.
Usage Notes:
=20
=20
=20
=20
Required?
Data Type
Example Value
Yes
String (column reference to Integer or Decimal v=
alues)
myColumn
limit_int
Nonnegative integer that defines the maximum number of values to extrac=
t into the list array.
NOTE: If specified, this value must between 1 and =
1000, inclusive.
NOTE: Do not use the limiting argument in a <=
code>LIST
function call on a flat aggregate, in which all value=
s in a column have been inserted into a single cell. In this case, you migh=
t be able to use the limit argument if you also specify a group<=
/code> parameter. Misuse of the
LIST
function c=
an cause the application to crash.
Usage Notes:
Required?
Data Type
Example Value
No
Integer
50
r=
owsBefore_integer, rowsAfter_integer
Integers representing the number of rows before or after the curre=
nt one from which to compute the rolling function, including the current ro=
w. For example, if the first value is 5
, the current row =
and the four rows after it are used in the computation. Negativ=
e values for rowsAfter_integer
compute the rolling f=
unction from rows preceding the current one.
rowBefore=3D1
generates the current row value only.
rowBefore=3D1
uses all rows preceding the cur=
rent one.
If rowsAfter
is not specified, then the value 0
is applied.group
parameter is applied, then these parameter=
values should be no more than the maximum number of rows in the groups.
Usage Notes:
Required?  Data Type  Example Value 

No  Integer  4 
Tip: For additional examples, see Common Tasks.
The following dataset includes the finishing times for each boat i= n a race. As part of the race, each boat may be assigned one or more penalt= ies in terms of seconds. So, the total time for the race is computed by add= ing two columns.
You are interested in the list of recent finishers by each finishi= ng time.
Source:
id  pilotName  boatType  raceTime  racePenalties 

1  Schmidt  Sunfish  4573.8  53 
2  Bolt  Laser  4934.21  11 
3  Masters  Force 5  4446.89  70 
4  Jamison  Force 5  4355.79  31 
5  Williams  Sunfish  4675.86  15 
6  Hobart  Laser  5077.5  50 
7  Millingham  Laser  4940.09  54 
8  Nelson  Force 5  5116.14  56 
9  Greene  Sunfish  5105.94  5 
10  Danielson  Laser  4964.03  18 
11  Cooper  Force 5  5281.55  13 
12  Stevens  Laser  5176.35  0 
13  Young  Sunfish  5038.11  16 
14  Thompson  Force 5  5252.9  62 
15  McDonald  Laser  5052.24  20 
16  O'Roarke  Sunfish  5080.76  45 
17  Collins  Sunfish  5176.09  10 
18  Wright  Laser  5391.61  34 
19  Black  Sunfish  5023.32  32 
20  Bush  Force 5  5200.37  28 
Transformation:
Compute the total time for each racer by summing the ra=
ceTime
column and the racePenalties
colu=
mn:
Transformation Name  <= code>New formula 

Parameter: Formula type  Single row formula 
Parameter: raceTime + racePenalties  FCTN(input) 
Parameter: New column name  'totalRaceTime' 
You can then compute the list of recent finishers by boat type, automati=
cally sorting the generated lists by the totalRaceTime
&nb=
sp;column:
Transformation Name  <= code>New formula 

Parameter: Formula type  Multiple row formula 
Parameter: Formula  rollinglist(boatType, 10, 4, 0) =20

Parameter: Order rows by  totalRaceTime 
Parameter: New column name  'last5FinisherBoatTypes' 
Results:
id  pilotName  boatType  last5FinisherBoatTypes  raceTime  racePenalties  totalRaceTime 

4  Jamison  Force 5  ["Force 5"]  4355.79  31  4386.79 
3  Masters  Force 5  ["Force 5","Force 5"]  4446.89  70  4516.89 
1  Schmidt  Sunfish  ["Force 5","Force 5","Sunfish"]  4573.8  53  4626.8 
5  Williams  Sunfish  ["Force 5","Force 5","Sunfish","Sunfish"]  4675.86  15  4690.86 
2  Bolt  Laser  ["Force 5","Force 5","Sunfish","Sunfish","Laser"= ]  4934.21  11  4945.21 
10  Danielson  Laser  ["Force 5","Sunfish","Sunfish","Laser","Laser"]<= /td>  4964.03  18  4982.03 
7  Millingham  Laser  ["Sunfish","Sunfish","Laser","Laser","Laser"]  4940.09  54  4994.09 
13  Young  Sunfish  ["Sunfish","Laser","Laser","Laser","Sunfish"]  5038.11  16  5054.11 
19  Black  Sunfish  ["Laser","Laser","Laser","Sunfish","Sunfish"]  5023.32  32  5055.32 
15  McDonald  Laser  ["Laser","Laser","Sunfish","Sunfish","Laser"]  5052.24  20  5072.24 
9  Greene  Sunfish  ["Laser","Sunfish","Sunfish","Laser","Sunfish"]<= /td>  5105.94  5  5110.94 
16  O'Roarke  Sunfish  ["Sunfish","Sunfish","Laser","Sunfish","Sunfish"= ]  5080.76  45  5125.76 
6  Hobart  Laser  ["Sunfish","Laser","Sunfish","Sunfish","Laser"]<= /td>  5077.5  50  5127.5 
8  Nelson  Force 5  ["Laser","Sunfish","Sunfish","Laser","Force 5"]<= /td>  5116.14  56  5172.14 
12  Stevens  Laser  ["Sunfish","Sunfish","Laser","Force 5","Laser"]<= /td>  5176.35  0  5176.35 
17  Collins  Sunfish  ["Sunfish","Laser","Force 5","Laser","Sunfish"]<= /td>  5176.09  10  5186.09 
20  Bush  Force 5  ["Laser","Force 5","Laser","Sunfish","Force 5"]<= /td>  5200.37  28  5228.37 
11  Cooper  Force 5  ["Force 5","Laser","Sunfish","Force 5","Force 5"= ]  5281.55  13  5294.55 
14  Thompson  Force 5  ["Laser","Sunfish","Force 5","Force 5","Force 5"= ]  5252.9  62  5314.9 
18  Wright  Laser  ["Sunfish","Force 5","Force 5","Force 5","Laser"= ]  5391.61  34  5425.61 