---
title: "Referencing Variables From Linked Models"
description: "Instead of a single model with all of your variables and formulas, you can structure your work into separate, smaller models. Once linked, you can reference variables between them as described in this chapter."
source_url: https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-edit-variables/referencing-variables-from-linked-models
language: en
last_updated: 2023-08-16
---
# Referencing Variables From Linked Models

## Overview

Instead of a single model with all of your variables and formulas, you can structure your work into separate, smaller models. Once linked, you can reference variables between them as described in this chapter.

For an instruction on how to link models, see [Linking Models](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/working-with-models/linking-models.md).

## Referencing Variables in Formulas

Once you have linked models, you can easily refer to any of the variables in that linked model when you are writing a formula, just by typing its name. The only difference is that it will show up as a **green variable** within a formula (see [variable types](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-edit-variables.md#vartyps)), and if you hover over the variable you will see which model it is coming from (and **Cmd/Ctrl+Click** will open the model).

Variable from a linked model

{% info-box %}
If your linked model variable is broken down by a dimension that is not in your current model, and you want to see the breakdown, you will have to link that dimension to the current model. You can do this either via clicking the dimension button on the variable and selecting the dimension, or by adding the dimension in the left-hand-side panel. See [Linking existing dimensions to models](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/using-dimensions/create-edit-dimensions.md). If you do not link the dimension to the model, the variable will just display on an aggregated basis (with no dimension items).
{% /info-box %}

{% info-box %}
If you reference a linked variable whose model has a different start/end date than the model you are in, any missing values will populate with the [empty value setting](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-edit-variables.md).
{% /info-box %}

## Referencing Entire Variables

If you want to bring in the entire variable from a linked model, within your current model, you can import the variable. This will allow you to visually see (but not edit!) the values of the imported variable across time, alongside the rest of the variables in the current model.

To do this - Click **New Variable** and then select **Import variable**. You can type in the name of the variable or the model that its in (even if it is not linked yet).

Importing a variable from a different model

It will now show up in the spreadsheet as a variable, and will be differentiated by its green name.

Variable that is coming from a linked model

Once you have imported a variable, you can broadly use it like any other variable in your model. You can use it in formulas, and you can add it to visuals. The main restriction is that you cannot directly modify an imported variable's attributes, except for its name and description. This variable gets the rest of its attributes from the model in which it "lives".

If you want to make changes to an imported variable, double-click the variable's link icon in the spreadsheet to "zoom in" to its model, and make the changes in the original model.

Open model in which the variable is defined.
