Wednesday, January 18, 2023

Cleaning Out Custom Calculations from OAC Workbook

When building visualizations in OAC, users take advantage of My Calculations to build custom calculations within the workbook.  Many of these custom calculations become obsolete for various reasons:
  • Newer versions of the original calculation are created.
  • Calculations are rebuilt in OAC subject area so they can be shared across multiple workbooks.
  • Calculations are pushed back to the ETL process for better report performance.
Having duplicate measures in a workbook can be confusing to the other users and possibly provide incorrect results on the visualization.  Below are a couple of steps to keep OAC workbooks as clean as possible.

Update Instead of Replace Calculations

Instead of making different versions of a calculation, change the existing calculation and add notes about the changes made. Use "/*" and "*/" to add comments to your calculation.  Besides reducing the number of calculations in a workbook, the new resulting values will automatically appear in the visualizations were the calculation is being used.  

Below is an screenshot example where changes were made to a calculation. Brown text are the comments and the blue text is the code.



Remove Calculations not Needed

Prior to moving a workbook into production or releasing to others, delete the calculations that are no longer used.  There are a couple of options:

Option 1:

Right click on the obsolete calculation and select Remove Calculation.  



This is the best option if there is only a few calculations to delete and you are confident they are not used in the workbook.  

The downside to this method is that each calculation must be deleted individually and  no warning is provided if the calculation is used in any of the visualizations.  This process removes the calculation from all visualizations throughout the workbook prior to deleting the calculation.  

Warning:  Don't use the computer Delete button to remove the calculations.  It will remove the calculations only while workbook is currently open.  Once the workbook is closed and reopened, the deleted calculations will reappear.  

Option 2:

Copy each of the canvases over to a clean workbook.  When you do this only the calculated measures being used in the visualizations will be copied. Below is an example with steps on how to accomplish this.

In the example we have a workbook with 18 calculations and 3 canvases.  See screen shot below.



Step 1:
Right click on the canvas and click on "Copy Canvas."



Step 2:
Open a new workbook in OAC.



Step 3:
Right click in the lower area to the right of Canvas 1.  "Paste Canvas" will appear.  Click on "Paste Canvas."


 

















Once this step is completed, the new workbook will contain the visualizations and data needed to support the visualizations for the imported canvas.  The visualizations in the Weekly Canvas, that was just imported, doesn't have any custom calculations (My Calculations) so none of the calculations from the original workbook were imported. 


Step 4:
Repeat Step 1 and Step 3 for the remaining canvases.  When done, only the custom calculations needed to support the visualizations will be in new workbook.  In the screenshot below, only 4 of the original 18 calculations are in the new workbook. 


Step 5:
Delete the blank canvas (Canvas 1) and save your workbook.  

This option is best if there several calculations to delete or you are unsure if the calculation is used in any of the visualizations. This is a safe and efficient way to remove any calculations that are not currently being used in this workbook.  
 
I hope you have found this helpful and best of luck.





Visualization – Santa Style

I have worked for years on data visualization with organizations making sure that key metrics stood out for executives and decision makers. ...