Using context variables to connect to the report database - 6.1

Talend Real-time Big Data Platform Studio User Guide

EnrichVersion
6.1
EnrichProdName
Talend Real-Time Big Data Platform
task
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

You can define context parameters and use them to execute data quality reports in different configurations, Prod and Test for example. There might be various testing stages you want to perform and validate before a group of reports is ready to go live on production.

Talend Studio offers you the possibility to create multiple context data sets. You can either create context data sets on a one-shot basis from the [Preferences] window of the studio, or you can create context data sets from the Contexts node in the Integration perspective and store them in the studio repository.

You can then select any of these repository context variables from the report editor in the Profiling perspective and use them to store report results.

For further information about contexts and how to centralize them in the studio repository, see Using contexts and variables.

How to export the report datamart settings as a context

Prerequisite(s):You have defined the settings of the report datamart in the [Preferences] window as outlined in Setting up a distant database. You have selected the Profiling perspective in the studio.

To export the settings of the report database as a context and use the context variables in the report editor, do the following:

  1. In the menu bar, select Window > Preferences to display the [Preferences] window.

  2. Start typing Reporting in the filter field and then select Reporting from the list to open the [Reporting] page.

  3. Click Export as context to open a context creation wizard.

  4. Follow the steps in the wizard to define the context variables and export as a context the datamart connection and the path of the report folder and logo file.

    A by-default name will be given to the context variables if you do not change them in the context creation wizard. The context variables will be centralized under the Contexts node in the Integration perspective of your studio.

    For further information about how to centralize contexts in the studio repository, see How to centralize context variables in the Repository.

    A message appears to show the progress of the operation, and then all connection settings become read-only.

  5. If needed, click Revert Context to switch the connection back to its initial state.

  6. In the DQ Repository tree view, right-click, one or several analyses and generate a report.

    The report editor opens on the report settings.

    In the Database Connection Settings view at the bottom of the editor, the connection settings are already filled in with the context variables defined and exported as a context in the [Preferences] window.

    The Context group Settings view shows the values of the context connection.

    The Contexts view shows the variables you exported and centralized in the studio repository, under the Contexts node in the Integration perspective. If this view is not open in the studio, use the combination Window > Show View > Profiling > Contexts to open it.

    Note

    A report created in the studio before you define and export context variables keeps its initial database settings. If you want to use it with a different datamart or context connection, you must open the report and select the context connection manually from the report editor. For further information, see How to select or update context variables from the report editor.

  7. Save the report and execute it.

    The report results will be written to the context connection defined in the report editor.

How to select or update context variables from the report editor

From the Contexts view in the report editor in the Profiling perspective, you can:

  • Click the button to select context variables from the studio repository, even if you have not exported the datamart settings as a context from the [Preferences] window of the studio.

  • Click the [+] button at the bottom of the Contexts view to define context variables from scratch.

  • Click the [+] button at the top right corner of the view to open a dialog box where you can configure context groups for the report.

For further information about contexts and their variables, see Using contexts and variables.

Prerequisite(s): You have selected the Profiling perspective in the studio. At least one context connection has been created and saved in the studio repository.

To change the context connection for a report from the report editor, do the following:

  1. Double-click a report in the DQ Repository tree view to open the report editor.

    If the Contexts view is not open in the editor, use the combination Window > Show View > Profiling > Contexts to open it.

  2. In the Contexts view, click the button at the bottom of the view.

    A dialog box opens to list all the context variables created and centralized in the studio repository.

  3. Select the check box of the context connection you want to use to generate the results of the current report.

    You can select more than one context connection.

    If you do not want to get the context variables from the studio repository but define them from scratch, you can click the [+] button at the bottom of the Contexts view and define the context values.

  4. Click OK.

    The variables of the selected context connections are listed in the Contexts view and in the Context group Settings view.

  5. Write the name of the context variable(s) from the Context group Settings table into the Database Connection Settings view. Write context. followed by the variable name.

  6. If required, you can modify any context variable by clicking the value you want to modify in the Contexts view.

    Context values are modified accordingly in the report editor but these updates are not propagated to the context group in the repository. You can run only the current report with the new context values.

  7. In the Database Connection Settings view, click Check to make sure that your connection is successful.

  8. Save the report and execute it.

    The report results will be written to the context connection defined in the report editor.