# Import values by reference

## Text

Text variables support an option to reference a file of text values to use in a selection.

[![Text reference file in My FastStats Folders](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-TextRefFile.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-TextRefFile.png>)

1. Copy and paste the file of text values from your computer desktop into a public or private folder within My FastStats Folders.

   In this example, the .txt file contains a list of telephone numbers.
2. Open a new selection and drag and drop to add the required variable across.

   [![Text variable added to selection window](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-TextVariable.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-TextVariable.png>)
3. In the bottom-right of the selection window, click on the **Import** icon.

   [![Import icon in the selection window](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-ImportIcon.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-ImportIcon.png>)
4. Navigate to the desktop folder that contains the file, select and then click **Open**.

   [![File browser showing selection of the text file](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-SelectFile.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-SelectFile.png>)

The records are pulled into the selection which can be built as normal.

[![Selection built with imported text values](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-BuildSelection.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-BuildSelection.png>)

## URN

If you have a file of reference numbers that you want to use as part of a selection, FastStats allows you to import the file.

1. Put the file of reference numbers on your computer desktop

   [![URN reference file on the desktop](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-URNRefFile.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-URNRefFile.png>)
2. Rename the file if necessary so that it has a .urn extension
3. Click on **Files** explorer within FastStats
4. Navigate to the URN file
5. Right click on the file and choose **Create URN File Description** as shown below

   The following dialog box will be displayed:

   [![Create URN File Description dialog](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-CreateURNFileDescription.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-CreateURNFileDescription.png>)
6. Open up the **System** explorer and drag and drop the reference number variable which the file relates to onto the drop area

   [![Import URN dialog with Households URN variable selected](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-CreateURNFileDescriptionDialog.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-CreateURNFileDescriptionDialog.png>)

   The image above shows the Import URN dialog after the Households URN has been chosen as the reference number to use.
7. Click **OK**

   The file should then appear in the **Files** explorer - similar to this: [![URN file in the Files explorer](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-HHURNFile.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-HHURNFile.png>)

> [!NOTE]
>
> If you are using FastStats through a web service (Enterprise), you **must** make sure that the newly created URN file is dragged into a folder within the private or public directory of **My FastStats Folders** on the server before you can use it in a selection.

To create a selection using this URN file, drag the file onto a new selection window:

[![Selection window with URN file dragged onto it](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-HHURNSelection.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-HHURNSelection.png>)

## Selector

You can import selector codes for use in a selection.

The default option is to **import by values** which takes the current values in a reference file and matches those current values to the relevant codes in order to select them.

There is a further option to **import by reference** - i.e. to reference the codes in a file at the time a selection is actually run.

1. Open a new selection and add the **Income** selector variable
2. Click on the **Import** icon at the bottom of the selection window to see the **Import Values** dialog

   [![Import Values dialog for the Income selector variable](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-ImportValuesIncome.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-ImportValuesIncome.png>)
3. Click on the **Import By:** drop-down and select **Reference**
4. Browse to the saved file and select

   The codes in the file are displayed in the **Current Contents** panel with conversion options available for **Contents after transformation**.
5. Leave the Conversion as **None** and click **OK**

The codes are pulled into the selection to be referenced against, and you can now build to see the current count of people meeting the criteria.

[![Selection built using imported-by-reference selector codes](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-ImportByReference.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-ImportByReference.png>)

If the codes in the file change, the changes are picked up and reflected when you next rebuild the selection.

## Numeric

Numeric variables support an option to reference a file of numeric ranges to use in a selection.

As with the previous examples, you must create and save the reference file into a private or public folder within My FastStats Folders. With numerics this should be a .txt or .csv file.

1. Open a new selection and drag and drop the required variable across - in this example booking **Profit**
2. Click on the **Import** icon, navigate to, and open your saved reference file
3. Build the selection to see the count

   [![Selection built with imported numeric ranges](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-NumericRefSelection.png>)](<https://help.apteco.com/assets/images/faststats/analysis/selections/import-values-by-reference/236-NumericRefSelection.png>)

If the reference file is updated, any changes will be reflected and updated when the selection is next rebuilt.
