Example - Create and Use a Multi-Source Session Variable
This topic provides an example of how to create and use the MVCOUNTRY multi-source session variable.
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).
- On your home page, click Navigator
and then click Semantic
Models. - In the Semantic Models page, click a semantic model to open it.
- Create the first variable.
- Create the second variable.
Use a Multi-Source Session Variable in an Expression
After you create the MVCOUNTRY multi-source session variable, you can use it in an expression.
For information about the MVCOUNTRY session variable used in this example, see Create a Multi-Source Session Variable.
This is an example of how to use the multi-source session variable in an expression:
select lastName, firstName, country from employee where country=VALUEOF(NQ_SESSION.MVCOUNTRY)
Use a Multi-Source Session Variable in a Data Filter
After you create the MVCOUNTRY multi-source session variable, you can use it in a data filter.
The MVCOUNTRY multi-source session variable is displayed in the Expression Editor's Variables tab. For information about the MVCOUNTRY session variable used in this example, see Create a Multi-Source Session Variable.