Home Search

DriveWorks Pro 22
TableWithSequence

Send Feedback

TableWithSequence

Prepends the given Table with a column containing sequence numbers. This is a convenient wrapper around using TableAppendColumns and TableSequence.

Syntax

TableWithSequence([Table],[Column Index],[Column Header])

Where:

Table is the table to add a sequence column.

Column Index is the position of the new column containing the sequence of numbers.

Column Header is the heading to display above the new column containing the sequence of numbers.

Example

RuleMeaning
TableWithSequence(DWGroupTableCustomers,1,"ID")Will return an array of the table Customers with a column added at the start, that has a header named ID, which contains sequential numbers.

Example Data

Customers Table

CustomerNameCityCountry
Amazon WarriorsParisFrance
Bolton BurnersConcordUnited States
Boston BullsHanoverGermany
Cambridge CatsToulouseFrance
Dynamo DynamicsIndianapolisUnited States
Eagle SizzlersColumbusUnited States
Everso LuckyBurlingtonUnited States
Forty SomethingsChicagoUnited States

Example Outcome

Customers Table

IDCustomerNameCityCountry
1Amazon WarriorsParisFrance
2Bolton BurnersConcordUnited States
3Boston BullsHanoverGermany
4Cambridge CatsToulouseFrance
5Dynamo DynamicsIndianapolisUnited States
6Eagle SizzlersColumbusUnited States
7Everso LuckyBurlingtonUnited States
8Forty SomethingsChicagoUnited States

DriveWorks will return the table above as an array, which will look like:

Table returned as an Array
{"ID","CustomerName","City","Country";1,"Amazon Warriors","Paris","France";2,"Bolton Burners","Concord","United States";3,"Boston Bulls","Hanover","Germany";4,"Cambridge Cats","Toulouse","France";5,"Dynamo Dynamics","Indianapolis","United States";6,"Eagle Sizzlers","Columbus","United States";7,"Everso Lucky","Burlington","United States";8,"Forty Somethings","Chicago","United States"}