Configure BI Optimizer for Tableau (Beta)

BETA FEATURE: BI Optimizer is a beta feature. Functionality, configuration steps, and supported options are subject to change as the feature evolves.

This article details how to configure the BI Optimizer App for Tableau in Metric Insights.

PREREQUISITES:

NOTE: The frequency must be set to at least once per day, but it is recommended to configure it to run every two hours.

  • Configured External Application for the Custom Script. The Application must have "Application Can Manage Users" enabled.

IMPORTANT: If BI Optimizer is already configured for another Data Source, complete Step 1 and Step 5.1, then run the Custom Script.

1. Create Tableau Datasets for Assets

  1. Access +New > Dataset > Create New
  2. Under Data Source, select the name of the Tableau Data Source to be optimized

Create the following Datasets:

It is recommended to use the same naming convention to make the instructions easier to follow.

  1. Tableau Usage Dataset from Tableau usage for 6 month 2.5.2025 / Views;
  2. Tableau Workbook Last Viewed Dataset from Tableau Usage for 6 month 2.5.2025 / last viewed time of workbook by username;
  3. Tableau License Analysis Dataset from Tableau Usage for 6 month 2.5.2025 / License Analysis;
  4. Tableau Group and User to Assets Dataset from Permissions / Sheet 1;
  5. Tableau User to Group Dataset from users-groups / Sheet 1.

NOTE: If BI Optimizer is already running for another Data Source, proceed to Step 5.1.

For more details on how to create Tableau Datasets, refer to Create Dataset from Tableau.

2. Create Empty CSV Datasets for App Template Entities and "Why Similar Storage" Variable

Access +New > Dataset > CSV Dataset

  1. Provide a descriptive Name. It is recommended to use the same naming convention to make the instructions easier to follow.
    • Datasets to be created for App Template Entities:
      • Report Cleanup access storage – for the accessData Entity;
      • Report Cleanup excluded storage – for the excludedRollups Entity;
      • Report Cleanup group data storage – for the groupToUserData Entity;
      • Report Cleanup processor storage – for the processorData Entity;
      • Report Cleanup unused storage – for the unusedInfo Entity.
    • Datasets to be created for Why Similar Storage variable:
      • Report Cleanup Criteria – for the criteriaDatasetId property;
      • Report Cleanup Criteria Hash – for the reportHashDatasetId property;
      • Report Cleanup Multipliers – for the multipliersDatasetId property.
        • IMPORTANT: Note the Dataset IDs required in Step 5.1.
  2. Choose a Category to place the Dataset.
  3. [Save]

3. Create a CSV Dataset for the Custom Script

Access +New > Dataset > CSV Dataset

  1. Create a CSV Dataset by uploading a CSV file with one column, reportName. This Dataset is only needed if you want to exclude specific Reports from the optimization. If you use it, make sure to include at least one Report name.
    • As a Dataset Name, it is recommended to use Report Cleanup Excluded names to make the instructions easier to follow.
    • NOTE: Names are not case sensitive. For example, "sales report" will exclude both "sales report" and "Sales Report".
    • IMPORTANT: Note the Dataset ID for use in Step 7.2. If you don't need to exclude any Reports, the Parameter can be left blank.

For more details on how to create CSV Datasets, refer to Create a Dataset from CSV File.

4. Create App Template

Access Content > Apps > Templates tab > [+New Template]

  1. Provide a descriptive Name such as "Report Cleanup".
  2. Name used in URL must be set to "report-cleanup".
  3. Display without Metric Insights navigation bar must be checked.

4.1. Upload Assets

  1. From the Assets tab, upload the Assets requested from Metric Insights Support as part of the prerequisites..
  2. The uploaded Assets will appear as a list.

5. Create App Based on This Template

Access Content > Apps > [+New App]

  1. Provide a descriptive Name.
  2. Choose the Template created at Step 4.
  3. [Save]
    • IMPORTANT: Note the App ID to be used in Step 7.2. See below.

5.1. Add Variables

Access the Content tab

  1. Connection Report Meta Datasets
    [+Add Item]
    , then fill in the following fields where needed:
PropertyDescriptionValue
connectionIdThe ID of the Tableau data source to be optimized 
datasetIdTableau Usage Dataset (see Step 1) 
workbookLuidKeyColumn name for the Workbook LUID key from the datasetID (above)default: workbook_luid
rollupNameKeyColumn name for the Rollup name key from the datasetID (above)default: project_name
reportNameKeyColumn name for the Report name key from the datasetID (above)default: workbook_name
accessListDatasetIdTableau Group and User to Assets Dataset (see Step 1) 
accessListKeysMapping

Mapping of the Access List Dataset keys to the connection report metadata Dataset keys. The mapping should be in JSON formatting. 

The keys in the object must be the keys (column names) from the accessListDatasetId Dataset. 

The value must be one of the following: username, groupName, rollupNameKey, reportNameKey, permission, or a special format object like 

{
 "name": "permission",
 "value":
 {
 "Allow": true,
 "Deny": false,
 "[DEFAULT]": false
 }
}

For help with this variable, contact Metric Insights support.

{
  "user_name": "username",
  "group_name": "groupName",
  "project": "rollupNameKey",
  "workbook": "reportNameKey",
  "permission_type":  
  {
    "name": "permission",
    "value":
    {
      "Allow": true,
      "Deny": false,
      "[DEFAULT]": true
    }
  }
}
groupToUserDatasetIdTableau User to Group Dataset (see Step 1) 
groupToUserKeysMapping

Mapping of the group to user Dataset keys to the connection report metadata Dataset keys. The mapping should be in JSON formatting.

The keys in the object must be the keys (column names) from the groupToUserDatasetId Dataset. 

The value must be one of the following: username, fullName, groupName.

See the example on the right for reference:

{
  "Name":"username",
  "Friendly Name": "fullName",
  "Name (Groups)":"groupName" 
}
lastViewedDatasetId

Tableau Workbook Last Viewed Date Dataset. 

Must include the user and report columns.

 
lastViewedKeysMapping

Mapping of the Last Viewed Dataset keys to the connection report metadata Dataset keys. 

The mapping should be in JSON formatting. 

The keys in the object must be the keys (column names) from the lastViewedDatasetId Dataset. 

The value must be one of the following: lastViewedAt, username, workbookGUID.

{
  "last_view_time": "lastViewedAt",
  "username": "username",
  "workbook_guid": "workbookGUID" 
}
additionalParams

Remove Report columns from the criteria list and skip them during duplicate calculations for this specific Data Source.

The value must be one of the following: true, false.

NOTE: To remove Report columns for all connections intended for BI optimization, configure the Additional Params variable below. 

{
  "disableColumnsCriteria": false
}


 

  1. Tableau Recommendations
    [+Add Item]
    , then fill in the following fields where needed:
PropertyDescriptionValue
tableauRecommendationsDatasetId

Tableau License Analysis Dataset. 

Must include the following columns: explanation, highest_license_type, performed_actions, potential_monthly_savings, recommended_license, site_name, site_role, username, actual_user_cost.

 
pricingMap

Pricing map for the Tableau recommendations. 

The mapping should be in JSON formatting. 

The keys in the object must be the keys from the tableauRecommendationsDatasetId Dataset. 

The object keys should be the Tableau role names, like Explorer, Creator, Viewer, Unlicensed, and the values should be the pricing for the role. 

Also, you can add includeRoles key with the array of roles that should be processed. The value should be an array of strings.  
For example: ["Explorer", "Viewer"]. The default value is the pricingMap key.

{
  "Explorer":504,
  "Viewer": 180,
  "Creator": 900,
  "includeRoles": ["Explorer", "Viewer", "Creator"] 
}

 


 

connectionIdThe ID of the Data Source for which the license usage is to be optimized (which may not be the same as the Data Source used for BI optimization). 
siteNamesThe name of the Tableau site for which the license usage is to be optimized. 

3. Why Similar Storage: fill in the IDs for the Datasets created in Step 3, strictly following  JSON formatting:

  • criteriaDatasetIdReport Cleanup Criteria Dataset ID;
  • reportHashDatasetIdReport Cleanup Criteria Hash Dataset ID;
  • multipliersDatasetIdReport Cleanup Multipliers Dataset ID.

4. Additional Params: set disableColumnsCriteria to "true" to remove Report columns from the criteria list and skip them during duplicate calculations for all connections configured for BI optimization.

  • NOTE: This parameter overrides the additionalParams configuration (see the Connection Report Meta Datasets table above), which removes Report columns only for the specific Data Source.

5. [Save]

5.2. Add Entities

Access the Entities tab

  1. [+Add App Entity], then the following Entities and configure them accordingly.
Entity Name"Type""Access Type""App Dataset"Dataset
accessDataInternalPublicYReport Cleanup access storage
assigneeInternalPublic  
clustersInternalPublic  
dataInfoInternalPublic
excludedRollupsInternalPublicYReport Cleanup excluded storage
groupToUserDataInternalPublicYReport Cleanup group data storage
historyInternalPublic  
processorDataInternalPublicYReport Cleanup processor storage
recommendationsInternalPublic  
unusedInfoInternalPublicYReport Cleanup unused storage

NOTE: If BI Optimizer is already running, test-run the Custom Script.

6. Create Run Sync Metadata Custom Script

Metadata refresh does not run automatically and does not depend on other refresh triggers. To run metadata refresh automatically, you must configure the Run Sync Metadata Custom Script and associate it with a daily Notification Schedule. This section explains how to do that.

Access Admin > System > Custom Scripts > [+New Custom Script]

  1. Provide a descriptive Name such as Run Sync Metadata.
  2. Choose an External Application (See prerequisites above).
  3. Specify an Authentication User (Admin or System Admin).
  4. [Save]

6.1. Add Parameters

  1. From the Info tab, [+Add Parameters], then add the following Parameters and configure them accordingly.
NameTypeRequiredDefaultAvailable Values
logLevelStringY info debug,info,warn,error,emergency,silent
pageIdNumber Y 
scriptTimeoutNumber Y600000

6.2. Add Parameter Set

  1. [+Add Parameters Set]
  2. Provide a descriptive Name like Default.
  3. Provide the ID of the App configured in Step 5.
  4. Enable Is Default.
  5. [Save]

6.3. Add Custom Script Code and Run Script

  1. Under the Editor tab, copy and paste the code from the Run Sync Metadata Custom Script file requested from our support team.
  2. Select the Parameter Set.
  3. [Run Script]
    • See the example output below.

6.4. Associate Notification Schedule With Run Sync Metadata Script

  1. Access Admin > Distribution > Notification Schedules
  2. Select the Notification Schedule determined in the Prerequisite steps.

NOTE: The Script must run at least once per day. Configure the Notification Schedule accordingly.

  1. Under the Run Scripts tab, [+Add Script].
  2. Choose the Custom Scrip created in Step 6.
  3. Choose the Parameter Set.
  4. [Save]

7. Create Custom Script

Access Admin > System > Custom Scripts > [+New Custom Script]

  1. Provide a descriptive Name such as Report Cleanup Processor.
  2. Choose an External Application (See prerequisites above).
  3. Specify an Authentication User (Admin or System Admin).
  4. [Save]

7.1. Add Parameters

  1. From the Info tab, [+Add Parameters], then add the following Parameters and configure them accordingly.
Name Type Required Default Available Values
pageId String Y    
storageEntityName String   processorData  
unusedForMonths Number   6 1,2,3,4,5,6
scriptTimeout Number   600000  
logLevel String   info debug,info,warn,error,
emergency,silent
reportColumnsMatchCaseSensitive String   true ,true
minColumnCountDuplicates Number   2  
worksheetNameMultiplier Number   0.1  
tableMultiplier Number   1  
tableColumnMultiplier Number   1  
reportColumnMultiplier Number   1  
tagMultiplier Number   1  
minOverlapInCluster Number   0.2  
filteredColumnTypes String Y string,date,DateTime  
clustersEntityName String Y clusters  
excludedRollupsEntityName String   excludedRollups  
thresholdReportsToBeUsed Number   0  
skipUnusedCheckForCreatedInDays Number   15  
unusedInfoEntityName String   unusedInfo  
removeUnusedFromClusters String     ,true
accessEntityName String   accessData  
groupToUserEntityName String   groupToUserData  
calculateAccess String     ,true
excludedReportNamesDatasetId Number      
excludedReportNamesObjectKey String   reportName  
minItemsCount Number   8  
excludeReportDashboards String     ,true

7.2. Add Parameter Set

  1. [+Add Parameters Set]
  2. Provide a descriptive Name like Default.
  3. Include the Report Cleanup Excluded names CSV Dataset ID if you are using one. Otherwise this can be left blank.
  4. Provide the ID of the App configured in Step 5.
  5. Enable Is Default.
  6. Fill in the rest of the fields based on the list below and [Save].

Parameter Description:

  • pageId: The ID of the App created in Step 5 above.
  • storageEntityName: The name of the storage entity where the script will store its data. (See Step 5.2) The default is processorData.
  • unusedForMonths: The number of months without activity after which a report is marked as unused. The default is 6.
  • scriptTimeout: The timeout for the script in milliseconds. The default is 600000 (10 minutes).
  • logLevel: The log level for the script. Values can be debug, info, warn, error, emergency, or silent. The default is info.
  • logColors: Specify whether to log colors in the console. The default is blank.
  • reportColumnsMatchCaseSensitive: Specify whether the report columns are case-sensitive. The default is true.
  • minColumnCountDuplicates: The minimum number of columns to consider for duplicates. The default is 2.
  • worksheetNameMultiplier: The multiplier for the worksheet name. The default is 0.1.
  • tableMultiplier: The multiplier for the table name. The default is 1.
  • tableColumnMultiplier: The multiplier for the table column name. The default is 1.
  • reportColumnMultiplier: The multiplier for the report column name. The default is 1.
  • tagMultiplier: The multiplier for the tag name. The default is 1.
  • minOverlapInCluster: The threshold percentage of similarity between two reports in a cluster, specified as a decimal. A report cluster will be included in the match results when the similarity percentage between any two reports in the cluster exceeds this threshold. Acceptable values range from 0 to 1 (e.g. 0.2, 0.35, 0.5), where 0 represents 0% similarity and 1 represents 100%. The default is 0.2 (20%).
  • filteredColumnTypes: The column types to be filtered out as a comma-separated list of types with no spaces. The default is string,date,DateTime.
  • clustersEntityName: The name of the clusters entity. (See Step 5.2) The default is clusters.
  • excludedRollupsEntityName: The name of the excluded rollups entity. (See Step 5.2) The default is excludedRollups.
  • thresholdReportsToBeUsed: The minimum number of views to consider a report as used. The default is 0.
  • skipUnusedCheckForCreatedInDays: The number of days after the report was created to skip the unused check. The default is 15.
  • unusedInfoEntityName: The name of the unused info entity. (See Step 5.2) The default is unusedInfo.
  • removeUnusedFromClusters: Specify whether to remove unused reports from clusters. The default is blank.
  • accessEntityName: The name of the access entity. (See Step 5.2) The default is accessData.
  • groupToUserEntityName: The name of the group-to-user entity. (See Step 5.2) The default is groupToUserData.
  • calculateAccess: Specify whether to calculate access information. The default is blank.
  • excludedReportNamesDatasetId: The ID of Report Cleanup Excluded names Dataset. (See Step 3) If not used, this can be left blank.
  • excludedReportNamesObjectKey: If using excludedReportNamesDatasetId, the column name from the dataset that contains the excluded report names. The default is reportName.
  • minItemsCount: The minimum number of items required in the report for processing to begin. The default is 8.
  • excludeReportDashboards: Not applicable for Tableau. Can be left blank.

8. Add Custom Script Code and Run Script

  1. Under the Editor tab, copy and paste the code from the BI Optimizer Custom Script file requested from our support team.
  2. Select the Parameter Set.
  3. [Run Script]
    • See the example output below.

9. Verify Result

Access Content > Apps > Report Cleanup Processor> [View]

10. Associate Notification Schedule with Custom Script

  1. Access Admin > Distribution > Notification Schedules
  2. Select the notification schedule determined in the Prerequisite steps.

NOTE: The Script must run at least once per day, but it is recommended to run it once every two hours. Configure the Notification Schedule accordingly.

  1. Under the Run Scripts tab, [+Add Script].
  2. Choose the Custom Scrip configured in Step 7.
  3. Choose the Parameter Set.
  4. [Save]
    • Once added, access the App and proceed to the Editor tab.