You can create one or several contexts for a database analysis and select specific context values with which to execute the analysis. Defining context variables in analysis will enable you to run the analysis on different data using the same connection.
Prerequisite(s): You have already created a database analysis in the Profiling perspective of the studio.
To define one context for an analysis, do the following:
Double-click the database analysis to open the analysis editor.
Select Window > Show View > Profiling > Contexts to open the context view in the Profiling perspective.
In the Contexts view, click the [+] button at the top right corner to open the [Configure Contexts] dialog box.
A Default context is listed by default.
Select the default context and click Edit to rename it, prod in this example. Click OK in both dialog boxes.
The context environment is named accordingly in the table in the Contexts view.
Click the [+] button at the bottom of the view to add lines in the table and define the name and values of the context variables.
Suppose that you want to profile a postal_code column and you want to analyze only the postal codes that start with 75. Name the variable where_clause and set the value to
postal_code like '75%'.
For further information about contexts and their variables, see How to define context variables in the Contexts view and How to centralize context variables in the Repository.
To define a second context for an analysis, do the following:
To add a new context, click the [+] button at the top right corner in the view and then click New... in the [Configure Contexts] dialog box.
Enter a name for the new context, dev in this example, and then click OK.
The legacy of the context selected as default in the context list is copied to the new context which is created and listed in the dialog box and in the Contexts view.
Click in the context table and modify the values of the new context as needed.
In this example, set the value of the where_clause for the dev context to
postal_code like '15%'.
Repeat the above three steps to add as many context environments as needed.
Click at the bottom of the view to import any of the contexts created and centralized in the studio repository and use it with the current analysis.
For detailed information on contexts and their management, see Managing Metadata for data integration.