# Klips: Writing formulas using results references in the Klip Editor

Results references enable you to refer to columns, series, and other sub-components after actions, date properties, and formulas are applied to them. You can use results references in the formula bar of the Klip Editor and when modelling a data source. This article describes using results references in the Klip Editor. To learn how to use results references in the modeller, go here.

Results references are most commonly used with actions and date properties to leverage displayed data or results of the actions and date properties in other calculations.

To use a results reference, type & into the formula bar and select from the list that displays.

Note: Results references refer to displayed data. Formula references refer to formulas before actions or date properties are applied. Learn more about formula references here.

Watch the video below for an example of using results references in the Klip Editor.

This article includes some examples of how you can use results references when writing formulas in the Klip Editor:

### Calculating the percentage of change

Results references can be used to simplify calculations. The following example describes how to use results references to calculate the percentage of change between two periods of time. A column is added to the table to show the percentage of change between the previous month’s sessions and the current month’s sessions.

The Klip below shows total sessions, from different mediums, by month: In this example, a column is added to the Klip to show the percentage of change between the sessions in the previous month and the current month.

To calculate the percentage of change:

1. In your dashboard, click the three-dot menu on your Klip and select Edit to enter the Klip Editor.
2. In the component tree, right-click the Table component, and click Add Column.
3. Set the Format as option to Percentage.
4. Select the Data tab and, in the formula bar, perform a percentage of change calculation using results references, as in the example below. 1. Click Save.

### Aligning data from two data sources

You can align data from two data sources using the LOOKUP function. Using results references in the LOOKUP formula enables you to reference columns after actions (for example, filtering and grouping) have been applied to them and maintain the results in further calculations.

The Klip below shows data for campaigns, clicks, and sessions from one data source: In this example, a column with calls data is added from a second data source using the LOOKUP function. The formula uses a results reference to ensure the actions applied to the data for the first data source are also applied to the calls data from the second data source.

To align data using LOOKUP and a results reference:

1. In your dashboard, click the three-dot menu on your Klip and select Edit to enter the Klip Editor.
2. In the component tree, right-click the Table component, and click Add Column.
3. Assign the Calls data to the fourth column in the table.
4. In the Calls column, use the LOOKUP function to ensure that the calls from the second data source are aligned with the rest of the data, as shown in the example below. 1. Click Save.

## Related articles

Have more questions? Submit a request