Table.generate_rows
generate_rowsoverason_problems
Group: Values
Aliases: duplicate, expand, repeat, replicate
Documentation
Generates additional rows of data by repeating existing rows based on a provided range.
Arguments
over: The range of values to use for the generation. This can be: ..Integer_Range or ..Date_Range - from: The starting value for the range. (Constant, existing column or expression) - to: The ending value for the range. (Constant, existing column or expression) - include_end: Whether to include the end value in the range. (Defaults to False) - step: The column with the step value for the range. (Defaults to 1 or ..Day)as: Optional new name for the expanded range column.on_problems: Missing columns are always an error. Other warnings like grouping on floating point numbers can be ignored or made an error with this argument.
Returns
- A Table of records with each incoming record duplicated by the number of times specified in the range.
Errors
- If the columns specified in
fromortoare not present in the table, aNo_Such_Columnerror is raised. > Example Generate 2 copies of each incoming row table = Table.new [["Input"], ["Hello"], ["World"]] generated = table.generate_rows (..Integer_Range 0 2) ## Returns a Table | Input | Generated Row | |-------|---------------| | Hello | 0 | | Hello | 1 | | World | 0 | | World | 1 |