Event References in SEL

Learn how to reference other events within SEL formulas.

Updated over a week ago

What is an Event Reference?

Sometimes you need to pull the value of one event into another event's SEL formula or expression. This is called an event reference and looks similar to a worksheet reference in a spreadsheet. When using an event reference, the internal value in the current period for the referenced event will be added to your formula's result.

How do I create an Event Reference?

To create an event reference in an event's formula or expression, you will use the reference event's title, prefixed with an exclamation point, and wrapped by single tick marks '. For example, an event called "Other Expenses" can be referenced in all of the following ways:

  • =!'Other Expenses'

  • =!'Other Expenses' + 10k

  • + !'Other Expenses'

πŸ”” Notes:

  • Since event references rely on event titles, you will run into issues if you give multiple events the same title. Make your event titles unique!

  • An event reference does not automatically include a recurring pattern, so make sure you select a recurring pattern if you'd like to reference values in subsequent periods for a recurring event.

  • Event references trigger AFTER the referenced event, so values may start to appear in a period later than expected. For example, if a monthly recurring event starts in January, a monthly event reference will see its value first appear in February. To ensure both values appear in the same period, select the End of Month recurring pattern for the event reference. Alternatively, you can use a custom recurring pattern to have the event reference trigger in the minute immediately following the referenced event, like so: 1 8 1 * *. This ensures both events trigger on the same day in quick succession.

Generators & Containers

You can also use event references as the initial values for the construction of a function, like a generator or a container. For example:

  • =Source(!'Developer Salary')

  • =Funnel(!'Initial Deposit', !'Spending Rate')

πŸ”” Note: Unlike formulas, when calling a generator or container, the values from the reference will only be used to initialize the new event. Once the event is initialized, the reference values then dissolve and the generator / container runs as written, without calling the reference event.

Can I reference events in a different board (i.e. model)?

Yes! Models don't have to run in isolation. Using the Tunnel function, you can connect the results from one model to another. This can help keep your models organized and makes them reusable.

For example, you may wish to create a budget for your organization, but prefer that each team lead creates a budget for their department first. Tunnel is the perfect solution! Each lead can have a unique model that informs their department's budget, and you can then pull the results into a consolidated model for the whole organization!

To use Tunnel to access an event from a different model, follow the format below:

=Tunnel("SaaS Marketing Model::Total Marketing Budget")

This tells the simulation to use the Total Marketing Budget event that lives inside the SaaS Marketing Model model in place of this event. The output table will show results of the Total Marketing Budget event. The tunnel will also behave like the remote event (in reality, it is the remote event).

πŸ’‘Note: Tunneling to an event does not modify the connected event or model.


Did this answer your question?