Using columns and rows in SRL

Using columns in SRL

To include a column value in an SRL expression, type out the name of the column in your expression. Column names can be used in an expression just like a written value. The type of the value is determined by the type of the column.

For example, given the column "Age", you could write Age + 1, or Age * 3 / 4.

Column names are case sensitive.

Age is not the same as aGE.

If the column name is a reserved word or contains spaces, then enclose the name in brackets:

[Employee Discount]

If the column name is a reserved word, then the column name should also be enclosed in square brackets:

[false]

where false without square brackets is a reserved word.

As a general option, always enclose column names in square brackets so as not to make a mistake:

[any column name with or without spaces, including service words]

You can tag a column, using the [#tagname] construct. This way, you can give the column a derived name and use that name instead of the original one. To do this, open the results window of the data source node, right-click on the column and select the Configure option.

srl tag config

Then go to the Tags tab and specify the tag.

srl tag new

Click Add tag to save the tag.

Using rows in SRL

You can address a particular row when working with columns as well. For this use {curly brackets} with a number after a column name in an SRL expression. The number given in curly brackets is an offset value (an index value) of the rows which are returned.

For example, togglecase([Mpg]{1}) will apply the function to the next value of the row, i.e. the second value of the original column.

Note that the first row in the column has an index of 0.