# Configure Signal Calculation Objects

Signal calculation objects run simple and advanced calculations to return a list of _Product-Event Combinations_ (PECs). Users can use these objects to manually run calculations against data sources to generate ad-hoc results. 

Signal calculation objects include:
* _Signal Calculations Setting_: This object groups _Signal Calculations_ together for a particular _Product Type_, for example, _Drugs_. 
* _Signal Calculations_: This object allows you to specify whether a simple (SQL) or advanced calculation will be used in the run. This object also references a <a href="/en/gr/753138/">safety view</a> and its configuration (for example, SQL and filters) for the run.
* _Signal Calculation Runs_: This object references a _Signal Calculations Setting_ and _Signal Calculation_ to accomplish the following:
    * Admins can troubleshoot and test the calculation setup. 
    * Users can manually run ad-hoc signal calculations. 

For more information on calculations, see <a href="/en/gr/752951/">Signal Detection Calculations</a>.

## Prerequisites

Consider the following prerequisites:
* Configure your Vault to use the following advanced calculations in _Signal Calculation Runs_: 
    * <a href="/en/gr/795472/">Empirical Bayes Geometric Mean (EBGM)</a>
    * <a href="/en/gr/1004213/">Information Component (IC)</a>
* To store _Signal Calculations_ of different data sources in a single _Statistical Data_ record, you must <a href="/en/gr/1005912/">enable Multi-Source Signal Data Consolidation</a>.

## Create Signal Calculations Settings

To create _Signal Calculations Settings_ records:
1. Navigate to **Business Admin > Objects > Signal Calculations Settings**. 
2. Select **Create**. 
3. Complete the following information: 
    * **Name**: Enter a name for the _Signal Calculations Setting_. For example, "Drugs from Safety Database".
    * **Description**: Enter a description for the _Signal Calculations Setting_. 
    * **Results Output**: Select one of the following options from the drop-down:
        * **Single Record**: Select this option to save all _Signal Calculation Run_ results in a single _Statistical Data_ record, regardless of the data source. If you select this option, consider the following requirements to ensure a successful calculation run:
            * _Signal Calculations_ must reference [_Signal Views_][3] at either the MedDRA query level or Preferred Term (PT) level, but not both. 
            * _Signal Calculations_ must not be associated with _Signal Views_ for subgroups.
        * **Multiple Records**: Select this option to save _Signal Calculation Run_ results with different data sources in separate _Statistical Data_ records. If you leave the _Results Output_ field blank, Vault defaults to this behavior.
4. Select **Save**.

### Create Signal Calculations

To add _Signal Calculation_ records to the _Signal Calculations Setting_:
1. {: #add-signal-calculation} Expand the _Signal Calculations_ section and select **Create**.
2. In the _Create Signal Calculation_ dialog, complete the applicable [fields][2]. 
3. Select **Save**.
4. <a href="/en/gr/753138/#view-parameters">View parameters</a> configured on the associated safety view appear in the _Filters_ section. Expand the section to provide parameter values as needed. For _Signal Calculations_ associated with _Signal Views_ for <a href="/en/gr/935433/#subgroups">subgroups</a>, you must select the subgroups from the _Signal Subgroups Picklist_ for which Vault will segment the PEC results. If you want to add custom _Subgroup_ picklist values, contact your Veeva Representative.
5. Create additional records as needed.

If this _Signal Calculation_ uses the _Advanced_ query type option, you must [specify the calculation mapping][1].

### Signal Calculation Fields {#signal-calculation-fields}

<table>
    <thead>
        <tr>
            <th>Field</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><em>Query Type</em></td>
            <td>Select <strong>SQL</strong> or <strong>Advanced</strong> from the drop-down. <br>
                The <em>SQL</em> option references the SQL in the associated <a href="/en/gr/753138/">safety view</a>, whereas the <em>Advanced</em> option uses more complex calculations.</td>
        </tr>
        <tr>
            <td id= "calculation-field"><em>Calculation</em></td>
            <td>If you selected the <em>Advanced</em> query type, this field appears and is required. Select an advanced calculation option from the drop-down.</td>
        </tr>
       <tr>
            <td><em>Prior Used</em></td>
            <td>If you selected the <em>IC</em> calculation, this field appears and is required. This field affects the amount of shrinkage, meaning how much the calculation shrinks the estimated case counts for rare PECs to provide a more stable and reliable estimate. The following options are: 
                <ul>
                    <li><strong>Default</strong>: This option provides minimal shrinkage.</li>
                    <li><strong>Jeffreys</strong>: This option provides a moderate amount of shrinkage.</li>
                    <li><strong>BCPNN</strong>: The Bayesian Confidence Propagation Neural Network, which provides a stronger shrinkage.</li>
                </ul>
            </td>
        </tr>
       <tr>
            <td id= "signal-view-field"><em>Signal View</em></td>
            <td>Select a <strong>Signal View</strong> from the drop-down or select the <strong>Advanced Search</strong> (<img class="inline" src="https://platform.veevavault.help/assets/images/saf-binoculars-icon.png" alt="saf-binoculars-icon" style="" />) icon to use filters and refine your search. To return Safety data at the <em>Product Family</em>-MedDRA query level or <em>Aggregate Reporting Group</em>-MedDRA query level, select the appropriate <em>MedDRA Query</em> view; MedDRA query level views support Safety data only. Otherwise, Vault returns results at the <em>Product Family</em>-MedDRA event level or <em>Aggregate Reporting Group</em>-MedDRA event level.</td>
        </tr>
       <tr>
            <td id= "case-series-view"><em>Case Series View</em></td>
            <td>If you selected the <em>SQL</em> query type, this field appears. Select a <em>Signal Case Series</em> view from the drop-down or select the <strong>Advanced Search</strong> icon to use filters and refine your search. To use a <em>Signal View</em> as a <a href="/en/gr/935435/#signal-case-series"><em>Case</em> series</a>, you must <a href="/en/gr/753138/#create-and-access-safety-views">enable the <em>Signal Case Series Enabled</em> checkbox</a> on the respective view.</td>
        </tr>
       <tr>
            <td><em>Data Source</em></td>
            <td><p>If the <em>Signal View</em> is for a non-Safety database, Vault populates the respective data source. For the Safety database, Vault leaves this field blank.</p>
                <p>A <em>Signal Calculations Setting</em> supports <em>Signal Calculations</em> of different data sources.</p>
            </td>
        </tr>
       <tr>
            <td><em>View Parameters</em></td>
            <td>Vault populates view parameter information.</td>
        </tr>
       <tr>
            <td id= "output-type-field"><em>Output Type</em></td>
            <td>From the picklist, select the type of output for storing the results of the <em>Signal Calculation</em>:
                <ul>
                    <li>Select <strong>Statistical Data Record</strong> or leave the field blank to store results in <em>Statistical Data</em> and CSV files.</li>
                    <li>Select <strong>CSV Attachment</strong> to store the results only in CSV format. Calculations with a <em>CSV Attachment</em> output can be run only when the associated safety view contains a MedDRA Query ID <a href="/en/gr/753138/#view-columns">view column</a> and when the safety view is not <em>Signal Case Series</em>-enabled.</li>
                </ul>
            </td>
        </tr>
    </tbody>
</table>

### Signal Calculation Mapping

This section applies to _Signal Calculation_ records with the _Advanced_ query type only. Vault allows you to map advanced calculation values to the corresponding field on the _Statistical Data_ record.

Simple calculation (SQL) field mapping is already <a href="/en/gr/753138/#sql-editor">defined on the safety view</a>. For advanced calculations, you can configure custom field mapping that can then be used to <a href="/en/gr/752951/#stratification">stratify</a> data for an advanced calculation score.

To configure signal calculation mapping:
1. In the relevant _Signal Calculation_ record with an advanced calculation as the selected calculation, expand the _Calculation Mapping_ section.
2. Select **Create**. \
    A _Create Signal Calculation Mapping_ dialog appears.
3. Complete the following information:
    * From the **Calculation Output Value** drop-down, select an option.
    * Enter the **Target Field Name** (ending in `__v`).
4. Optional: Add additional _Signal Calculation Mappings_ as needed.
5. Select **Save**.

**Results**

When you run this calculation against PV data, Vault returns the above scores and displays them in the target field on the _Statistical Data_ record.

## Create Signal Calculation Runs

Follow the steps below to create _Signal Calculation Runs_:
1. Navigate to **Business Admin > Objects > Signal Calculation Runs**.
2. Select **Create**.
3. Complete the following information:
    * **Name**: Enter a name for the _Signal Calculation Run_.
    * **Calculations Setting**: Select an option from the drop-down or select the **Advanced Search** icon to use filters and refine your search. 
    * **Calculation**: Select an option from the drop-down or select the **Advanced Search** icon to use filters and refine your search. After selecting a calculation, the _Filters_ section inherits the filters configured on the associated safety views. For more information about inheriting filters from the safety views, see <a href="/en/gr/753141/#set-the-available-on-report-editable--required-checkboxes">Add Safety View Filters in Safety Signal</a>. If you leave this field blank, when a user <a href="/en/gr/935433/">runs the _Signal Calculation Run_</a>, Vault runs all _Signal Calculations_ associated with the _Signal Calculations Setting_. Additionally, if this field is blank, you cannot add filters to the _Signal Calculation Run_.
    * **Reporting Period**: Select an option from the drop-down or select the **Advanced Search** icon to use filters and refine your search. 
4. In the _Filters_ section, expand each filter group and enter values for all required filters. Define optional filter parameters as needed. You can also add additional filters to this calculation run. See <a href="/en/gr/753141/#how-to-add-filters">Add Safety View Filters in Safety Signal</a> for instructions.
5. Select **Save**.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>:  When you add filters to a <em>Signal Calculation Run</em>, you must apply the same filters to all <em>Signal Calculations</em> in the <em>Signal Calculations Setting</em> to ensure data consistency.</p>
    </div>
  </div>
</div>



**Results**

When a user <a href="/en/gr/935433/">runs this _Signal Calculation Run_</a>, Vault considers the query type and all related filters when returning the results. 

[1]: #signal-calculation-mapping
[2]: #signal-calculation-fields
[3]: #signal-view-field