Adding Labels

TABLE OF CONTENTS

Overview

When you build a table or an extract, each dimension or source field is filled with coded items. To provide Browser users with the information they need to understand an item, additional labels (user-friendly descriptions) can be added.

You can enter labels manually or import them from a comma-separated value (CSV) file, a dimension definition file, or an ASCII file.

Preparing Labels in Comma-Separated Value Format

Comma-separated value files are prepared outside of Beyond 20/20. They must have an extension of .CSV.

  • The comma-separated value file you create must contain a field whose values match those in a field that is already in the dimension view. This field is called the lookup field. (It is usually the Code field.)
  • The first line of the comma-separated value file should contain the case-sensitive names of the fields in the dimension, one of which must be the lookup field.

For each row in the comma-separated value file, the Browser takes the Code field that you identify and uses it to search for a match in the lookup field of the dimension. When the Browser finds a match, it takes the corresponding label from the same row of the comma-separated value file and places it in the matching fields of the dimension that is being updated.

You can use any editor or spreadsheet, such as Microsoft Excel, to create a comma-separated value file.

These files contain the same number of fields in each row entry, delimited by commas, and each entry has a carriage-return and linefeed character at the end of it. Most spreadsheets packages allow you to save active spreadsheets in comma-separated value format.

You can import more than one set of labels by including several sets in the comma-separated value file.

To prepare a comma-separated value file in a spreadsheet:

  1. In the first row of your spreadsheet, enter the field names as they appear in the dimension view of the field you are importing labels into (that is, the lookup field).
    Example: Enter Code in cell A1 and Description in cell B1.
  2. In the Code column, enter the complete set of item codes for the dimension you are importing labels into.
  3. In the Description column, enter the corresponding labels.

  4. From the File menu of your spreadsheet program, choose Save As.

    The Save As dialog box appears.

  5. In the File name area, type or select the file you want to save. If necessary, choose a different location to save the file.

  6.  Select CSV (Comma delimited) (*.csv) as the Save as type, and then click Save.


Importing Labels

Sample.IVT file and .CSV files are included in the attached zip file, AddingLabels.zip. We will import the CSV files into the BIRTH STATE and EDUCATION CODE dimensions of 92grds.ivt.

To import a comma-separated value file:

  1. First open 92grds.ivt.
    You will import labels into the dimensions of this table.
  2. Select the BIRTH STATE dimension.
  3. Do one of the following:

    - From the View menu, select Dimension.

    - From the toolbar, select the Display Active Dimension button.
    The dimension window appears:

  4. From the File menu, select Import.

    The Import dialog box appears.

  5. Click the browse button at the end of the Input Filename area.

    An Import File dialog box appears.

  6. In Files of type, select Comma Separated (*.csv).

  7. In File name, select state.csv (located in the attached zip file, AddingLabels.zip).

  8. Click Open.

  9. In the Import dialog box, set the Lookup Field to Code. This is the field that will used when

    matching the labels.

  10. Click OK.
    The labels will be imported, as shown in the following screenshot:

  11. Close the Dimension window.

Repeat the same procedure to import the labels for the EDUCATION CODE dimension:

  1. Select the EDUCATION CODE dimension.

  2. Do one of the following: 
    From the View menu, select Dimension.
    From the toolbar, select the Display Active Dimension button.

  3. From the File menu, select Import.
    The 
    Import dialog box appears.

  4. Click the browse at the end of the Input Filename area.

  5. In the List files of type area, select Comma Separated (*.csv).

  6. In the File name area, select EDUC.CSV (located in the attached zip file, AddingLabels.zip ).

  7. Click OK.

  8. Close the Dimension window.

To view alternate labels:

  1. In the table view, select the BIRTH STATE dimension to make it active.
  2. Click the Next Label button on the toolbar to cycle through all the available labels.

Note: If you want to save the display of labels instead of codes as the default in your table view when you open the table, choose Save from the View menu.

See Also