Safety views determine the reporting data for a Workbench Report. You can also use safety views to preconfigure Workbench Report parameters such as filters and field grouping. These parameters are applied to a Workbench Report when a user selects the safety view on the Workbench Report.

Workbench includes the following safety views:

  • Principal Views: Contain the largest collection of data and preconfigured parameters. For example, a Principal View might include data for all Case versions. Vault derives all Workbench Views from a Principal View.
  • Supporting Views: Provides a subset of data for Principal Views to use in report generation, for example, expectedness information. Principal Views, Dynamic Views, and other Supporting Views may depend on this view type. If this view is materialized, Vault calculates and stores the query results during the daily data sync.
  • Workbench Views: Contain a subset of data from a specified Principal View and provide a more narrow and specific report analysis.
  • Dynamic Views: Contain commonly used Safety fields that users can add to Workbench Reports for ad-hoc analysis. You can associate these views with a Principal View using a Workbench View Dynamic Join. Before you can use these views, you must perform the necessary configuration.

Your Safety Workbench Vault includes standard safety views that cannot be edited. You can copy a standard view and then modify the parameters of the custom view. For more information about these views, contact your Veeva Representative.

The following sections in this article describe the different sections of a safety view and how to complete them.

saf-workbench-view-1

saf-workbench-view-2

Create and Access Safety Views

To create a safety view:

  1. Navigate to Business Admin > Objects > Workbench Views.
  2. Select Create.
  3. In the Create Workbench View window, specify the type of view you want to create and then select Continue.
  4. Complete the applicable fields in the Details section, then select Save.

Safety View Fields

The following fields may be available:

Field Description
Name Enter a Name for the safety view.
API Name Enter an API Name for the safety view. The API Name cannot include spaces and must end in __c.
Description Enter a Description for the safety view.
View Tag Select a tag from the picklist to organize this safety view. Add values to the Workbench View Tag picklist as needed.
Sortable by Row Number Select Yes to allow users to follow the sort order configured in this safety view's SQL. Contact your Veeva Representative to provide the appropriate input. Otherwise, select No.
Use Total Row This field appears for Workbench View types only. Select this checkbox to display a Grand Total row on Workbench Dashboards using this view. Then, contact your Veeva Representative to provide the appropriate SQL input.
Show Latest Version Only

This field appears for Principal View and Workbench View types only and is for latest Case versioning logic. To control the Case versions returned in report and dashboard outputs, select an option depending on the type of safety view you are creating:

  • When creating a Principal View:
    • Yes: Workbench Reports, Workbench Dashboards, and Workbench Report Sets using this view will return the latest Case versions, unless overridden on the specific Workbench View
    • No: Workbench Reports, Workbench Dashboards, and Workbench Report Sets using this principal view will return all Case versions, unless overridden on the specific Workbench View
    • Leave this field blank if you want to allow report and dashboard users to decide the Case versioning using the Allow User To Control Latest Version field
  • When creating a Workbench View:
    • Yes: Workbench Reports, Workbench Dashboards, and Workbench Report Sets using this view will always return the latest Case versions, regardless of the Latest Case Version field
    • No: Workbench Reports, Workbench Dashboards, and Workbench Report Sets using this view will always return all Case versions, regardless of the Latest Case Version field
    • Leave this field blank if you want to use the default logic defined on the Principal View
Allow User To Control Latest Version

This field appears for Principal View types only and is for latest Case versioning logic. Select an option to determine whether users have control over Case versioning in reports and dashboards:

  • Yes: Vault displays the Latest Case Version field on Workbench Reports, Workbench Dashboards, and Workbench Report Sets
  • No: Vault does not display the Latest Case Version field on Workbench Reports, Workbench Dashboards, and Workbench Report Sets
Materialize

This field appears for safety views of the Supporting View type only.

When you save a Supporting View as a materialized view, Vault runs the SQL and stores the results of the query in advance. This enhances performance and speed when generating Workbench Report and Workbench Dashboard results. Materialized views are useful for complex queries you plan to run repeatedly.

Materialized views also impact the speed of the daily data sync; not all views require this performance optimization. Workbench stops creating materialized views if it delays the daily data sync.

Select Yes to materialize the Supporting View; otherwise, select No.

Dependent Views

When creating a new safety view, this section appears only after saving.

A Workbench View is always dependent on another safety view, meaning it derives its data and configuration parameters from the specified safety view. The safety view on which the Workbench View is dependent is known as a dependent view. A dependent view can be a Principal View or another Workbench View.

Principal Views, Supporting Views, and Dynamic Views can depend on the Supporting View type only.

The safety view hierarchy starts with a Principal View, which leads into subsequent Workbench Views with a more specific data set. These Workbench Views can lead into other Workbench Views with even more specialized data sets.

saf-workbench-safety-view-hierarchy

Although a Workbench View may not always include a Principal View in the Dependent Views section, a Workbench View must ultimately be associated with one (1) unique Principal View through other dependent views. In the above example, Workbench View A.1/A.2 is not directly associated with the Principal View but is associated with it through Workbench View A.

Create a Dependent View

To add a dependent view:

  1. In the Dependent Views section of the safety view, select Create.
  2. In the Create Workbench View Dependent window, select a Dependent View.
  3. Select Save or Save + Create to add another dependent view.

Vault adds the selected dependent view(s) to the Dependent Views section and generates a name for each.

The current view is now dependent on these selected safety views.

SQL Editor

SQL offers elaborate queries for parsing through data. You or your Veeva Representative can provide and input queries in the SQL Editor section. The queries are based on Amazon Redshift SQL, which is a subset of PostgreSQL 9.x. For more information on the available SQL functions, refer to Amazon Redshift and PostgreSQL. You can enlarge the SQL Editor section by selecting the Full Screen (maximize-sql-icon) icon.

The SQL query provides references for the fields specified in the safety view’s Workbench View Columns section. If you run a preview of the safety view without any Workbench View Columns, all fields returned by the SQL query will be displayed in the preview.

The safety view can also leverage another safety view by referencing the safety view’s API Name in the SQL Editor section, for example, select * from ${safety_view_api_name__c}. You must also create a dependent view for the safety view you are referencing.

Consider the following SQL limitations and restrictions:

  • Vault does not perform timeout checks when running SQL. Long-running queries will be terminated by Amazon Redshift. Related performance issues are identified through logged server errors.
  • The query size limit is 32,000 characters.

SQL Editor Search Panel

Before you can access SQL Editor keyboard shortcuts and the search panel, you must configure SQL Editor enhancements. After performing the necessary configuration, you can open the SQL Editor search panel by using the  Ctrl + f or Cmd + f keyboard shortcut, as applicable.

Using the search panel, you can find or replace specific texts and syntax elements. The panel also includes the following settings:  

  • Match case: Select this checkbox to make your keyword case sensitive.
  • Regexp: Select this checkbox to use regular expressions.
  • By word: Select this checkbox to search for whole words only. For example, if your keyword is filter, Vault excludes elements such as filterview.

Workbench View Objects

The Workbench View Column and the Workbench View Object sections both influence the Workbench Report layout. Where the Workbench View Columns define the fields users can add to the layout, the Workbench View Objects specify the fields you can group by on the Workbench Report layout. If you do not add Workbench View Objects to this safety view, grouping will not be available for Workbench Reports using this view.

The Workbench View Objects section consists of fields and one (1) parent object. The fields in this section correspond to the fields in the Workbench View Columns section.

Create Workbench View Objects

To create Workbench View Objects:

  1. In the Workbench View Objects section, select Create.
  2. In the Create Workbench View Object window, complete the following information:
    • Name: Enter the name of the field.
    • API Name: Enter the API name of the field. This value must end in __c.
    • Parent Object: Select the parent object from the drop-down or use the Advanced Search (binoculars-icon) icon to use filters and refine your search. Leave this field blank if you are creating the parent object.
  3. Select Save.
  4. Repeat the steps above to add additional fields.
  5. (Optional) To delete a field, select the Actions menu next to the field and then select Delete.

Grouping Criteria

Users can group fields on the Workbench Report and Workbench Dashboard layout if the following criteria are met:

  • The corresponding Workbench View Object must exist for the field.
  • In the Workbench View Objects section, the field the user wants to group by is assigned to the parent object.
  • In the Workbench View Columns section:
    • For the field the user wants to group by, there is a corresponding field in the Workbench View Column section.
    • The field must be of the Object, Picklist, Text, or MedDRA column type.
    • The field’s Workbench View Object field must be set to the parent object.

Workbench View Columns

When creating a new safety view, this section appears only after saving.

The Workbench View Column fields you create on a Principal View or Dynamic View are available to add as filters on Workbench Reports and Workbench Dashboards. Users can also add these fields to the Layout section on Workbench Reports and Workbench Dashboards, regardless of the safety view type.

The Workbench View Columns are also required for the safety view’s SQL to run successfully.

Supported field types include:

  • Text
  • Date
  • DateTime
  • Number
  • Yes/No
  • Object
  • Picklist
  • Multi-Value Picklist
  • MedDRA

Create Workbench View Columns

To create the Workbench View Columns:

  1. In the Workbench View Columns section, select Create.
  2. In the Create Workbench View Column window, complete the applicable fields.
  3. Select Save.
  4. The Primary Key field applies to safety views with Workbench View Objects. Each Workbench View Object must have one Workbench View Column with the Primary Key column set to Yes and can have unlimited Workbench View Columns with the Primary Key column set to No.
  5. Repeat the steps above to add additional columns.
  6. (Optional) To delete a field, select the Actions menu next to the field and then select Delete.

The Latest Version Reference Column Join section applies to latest Case version logic and is used to associate two Workbench View Columns of the Date or DateTime type.

Workbench View Column Fields

The following fields may be available:

Field Description
Name Enter the name of the Workbench View Column. This value appears to users as a field in the Workbench Report layout.
API Name Enter the API name of the Workbench View Column. This value must match the name of the column returned by the SQL query.
Column Type Select a field type option from the drop-down. For Object and MedDRA types with a specified Safety Object Reference, Vault displays the record name instead of the ID for Workbench Dashboards and Workbench Report outputs.
Safety Object Reference The Safety Object Reference and Safety Object Constraint fields allow you to restrict the values that appear when filtering on this object. For example, you can restrict the Controlled Vocabulary object to display only Drug Roles. Enter the API name of the object associated with this view column field.
Safety Object Constraint The Safety Object Reference and Safety Object Constraint fields allow you to restrict the values that appear when filtering on this object. For example, you can restrict the Controlled Vocabulary object to display only Drug Roles. Enter VQL to configure a reference constraint to restrict the object values.
Case Version Key

This field enables using Case series for Workbench Reports. If you do not see this field, you must first enable Case series.

  • For the id view column field, select Yes. You must set this field on the safety view’s dependent Principal View and, optionally, on the safety view. When this field is set only on the Principal View, Vault applies the Principal View’s parameters to the Case series to generate the report output. When this field is set on both the safety view and the Principal View, Vault uses the safety view’s parameters.
MedDRA Hierarchy For view columns of the MedDRA column type, Vault sets this field to LLT by default. You cannot edit this field.
Hide from filters Select Yes to prevent users from filtering reports and dashboards on this field. Otherwise, select No.
Workbench Filter Group On a Principal View or Dynamic View, select a filter group to categorize the Workbench View Column filter. These groups appear in the Workbench Dashboard filter panel under the Additional Filters section. If you do not see this field, you must first add it to the Workbench View Column object layout.

Create Dynamic View Joins

For Principal Views, use Workbench View Dynamic Joins to associate the Principal View with a Dynamic View.

Workbench View Parameters

When users apply filters to Workbench Reports, the data set can change before the safety view SQL queries them. Using Workbench View Parameters, users can enter filter values on the Workbench Report that can then be referenced directly by the safety view’s SQL. Workbench View Parameters may appear as optional or required filters in the Filters section under the Criteria subsection.

Create or Add Workbench View Parameters

To create Workbench View Parameters:

  1. In the Workbench View Parameters section, select Add.
  2. In the Search: Workbench View Parameter dialog:
    1. Filter for and select existing parameters.
    2. Select Create. Complete the applicable fields and then select Save or Save + Create to save the record and create another.
  3. Select OK.

After you add a Workbench View Parameter to a safety view, Workbench Reports, Workbench Dashboards, and Workbench Report Sets that use this safety view will require the user to enter a criteria value. This criteria value is used directly in the SQL query by entering the ${parameter.api_name} token. For example, a parameter of the Yes/No column type is created to exclude follow-up Cases and it is named exclude_followup__c. In the SQL Editor, this parameter would be referenced as:

CASE WHEN ${parameter.exclude_followup__c} <SQL>
${parameter.exclude_followup__c} THEN <SQL>

Workbench View Parameter Fields

The following fields may be available:

Field Description
Name Enter a name for the Workbench View Parameter.
Description Enter a description for the Workbench View Parameter.
API Name Enter an API name for the Workbench View Parameter ending in __c.
Optional Select Yes if the parameter is not required for the report to run. Leave this field as No if the parameter is required.
Column Type Select a field type option from the drop-down.
Allow user to select multiple values If the Column Type is either Picklist or Object, you may select Yes to allow users to select multiple values for this Workbench View Parameter. Otherwise, select No.
Picklist Reference This field allows you to restrict the values that users may enter. Enter the API Name of the desired picklist.
Safety Object Constraint The Safety Object Reference and Safety Object Constraint fields allow you to restrict the values that appear when filtering on this object, for example, restricting the Controlled Vocabulary object to display only Drug Roles. Enter the API Name of the object associated with this view column field.
Safety Object Reference The Safety Object Reference and Safety Object Constraint fields allow you to restrict the values that appear when filtering on this object, for example, restricting the Controlled Vocabulary object to display only Drug Roles. Enter VQL to configure a reference constraint to restrict the object values.
Default Value Object

Leave this field blank. Workbench Reports and Workbench Dashboards do not support this field.

Default Value Object Field

Leave this field blank. Workbench Reports and Workbench Dashboards do not support this field.

Filters

You can configure filters in the Filters section of the safety view. Filters you add to the safety view can also be used to generate an output when users run a Workbench Report.

You can add safety view filters only if the Workbench View Columns section is populated. To add safety view filters on a Workbench View, you must first define Workbench View Columns on the associated Principal View.

For more information, see Add Safety View Filters in Safety Workbench.

Run Preview

You can generate a preview of the safety view by selecting Run in the Run Preview section.

After you run the preview, Vault executes the SQL for this safety view and returns a list of up to 100 records. Optionally, you can select the column header to sort the records returned by the run preview. The preview output also depends on whether you select the Use View Columns checkbox:

  • If you leave the checkbox selected: Vault returns fields that are defined by the SQL and have a corresponding Workbench View Column. The output is displayed in a table format based on the Workbench View Columns’s column type.
  • If you clear the checkbox: Vault returns all fields specified in the SQL, regardless of whether the safety view contains Workbench View Columns. Clearing the Use View Columns checkbox allows you to preview your SQL changes quickly without having to configure Workbench View Columns.

If the SQL is invalid, Vault returns an error. Run Preview also times out after 300 seconds.

Vault inactivates the Run button when you add a Workbench View Parameter to the safety view, as Workbench View Parameters require user input to obtain data.