Create a Multi-Source Session Variable

This topic explains how to create the MVCOUNTRY multi-source session variable. When you add the MVCOUNTRY variable to an expression or data filter, it returns data from the Oracle and Snowflake data sources.

After you create a multi-source session variable, the variables definitions are listed in the initialization block's definition (for example, MVCOUNTRY____ORCL and MVCOUNTRY____SNFL). But in the Expression Editor, the multi-source session variable name is displayed (for example, MVCOUNTRY).

See About Multi-Source Session Variables.

  1. On your home page, click Navigator Navigator icon and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Create the first variable.
    1. Click Variables Variables icon.
    2. Click Create Create icon and then click Create Initialization Block.
    3. In Create Initialization Block, go to the Name field and enter mvcountry_orcl_init.
    4. Go to the Type field and select Session. Click OK.
    5. Confirm that the Variables tab is displayed, and then go to the Query Returns field and select Variable names and values.
    6. Go to the Select Statement: DEFAULT field and enter the following initialization query, using four underscores between the variable name (MVCOUNTRY) and the source (ORCL):
      select distinct 'MVCOUNTRY____ORCL', country from oracle_table
    7. Go to Connection Pool and click Select to browse for and select a connection pool.
    8. Click Add Variable Add variable icon and enter the name MVCOUNTRY____ORCL. You need to add four underscores between the variable name and the source name.
    9. Click Save.
  4. Create the second variable.
    1. Click Variables Variables icon.
    2. Click Create Create icon and then click Create Initialization Block.
    3. In Create Initialization Block, go to the Name field and enter mvcountry_snfl_init.
    4. Go to the Type field and select Session. Click Add.
    5. Confirm that the Variables tab is displayed, and then go to the Query Returns field and select Variable names and values.
    6. Go to the Select Statement: DEFAULT field and enter the following initialization query, using four underscores between the variable name (MVCOUNTRY) and the source (SNFL):
      select distinct 'MVCOUNTRY____SNFL', country from snowflake_table
    7. Go to Connection Pool and click Select to browse for and select a connection pool.
    8. Click Add Variable and enter the name MVCOUNTRY____SNFL. You need to add four underscores between the variable name and the source name.
    9. Click Save.