Skip to content

Data Transformations

Rodrigo García-Herrera edited this page Feb 18, 2019 · 2 revisions

To add a new data transformation to the pipeline, click the New Transform button and choose a transformation from the list. After filling out the transformation's properties, click Add To Pipeline. The transformation will now appear above the data table, which will have updated to reflect new data fields and values.

Filter

This transformation removes unwanted items from the pipeline. Drag data fields into the For field to specify the filter conditions; items that meet this condition remain in the pipeline, items that do not are filtered out.

The For field must contain an expression (using JavaScript syntax) that evaluates to true or false. All JavaScript Math functions and constants are available (no prefix required), for example PI or abs.

Note: You cannot simply type the name of a data field into the For field. You must drag and drop it from the data table.

Sort

Sort the data according to the field dragged to the `By` property in the specified `Order`.

Formula

The formula transform extends the dataset according to a calculation formula.

Data fields can be dragged to Formula field to construct an expression for the formula (using JavaScript syntax). All JavaScript Math functions and constants are available (no prefix required), for example PI or abs.

Note: You cannot simply type the name of a data field into the Formula field. You must drag and drop it from the data table.

In the As field, enter the name of the new field that will be populated using the calculated formula.




Group By

This transform organizes a dataset into "groups" or "facets".

Multiple data fields can be dragged to the transform's Fields property. Once the transform is added to the pipeline, the data table is split into a tabbed view, one tab per group (left).

These data groups correspond to visual groups (right), which are automatically generated by Lyra when a mark is set to use a grouped pipeline. A visual group's Layout property controls how it is spaced: either uniformly across the canvas (horizontally or vertically), or using a custom layout (overlap).

We get one visual group per data group and then, for marks within the visual group, one mark per data element within the data group. As a result, the group by transformation is an effective way for automatically generating small multiple displays.

Groups laid out horizontally or vertically can also be created more quickly by dragging a data field over the group dropzones which hug the edge of the current layer.

Statistics

Once a group by transformation is applied to a pipeline, a number of aggregate statistics can be calculated for numeric fields over each group separately.

Once a data field is dragged to a property, hover over it and click the arrow. This displays a popover from which a statistic can be chosen. Lyra currently supports count, min, max, sum, mean, median, variance, and stdev.