Locking/Unlocking a Model
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Locking/Unlocking a Model

  • Dark
    Light
  • PDF

Article summary

How to Lock a Model?

  1. In SpotlightXL, access the Model >Setup page.
  2. Select a Generated model.
  3. Click the Lock Model action (which is only enabled when a Generated model is selected). Notice the Status of the model changes from Generated to Locked as shown below. Also notice that the Lock Model icon changes to Unlock Model.

newlockunlock.png

While locking a model ensures data integrity and prevents clearing the data, it also means that all data may not be saved/updated (see Saving Report Data to Locked Models and Saving View Data to Locked Models) from Views, Reports, Data Load, API Library, Calculation, and so on.

See: Saving Report Data to Locked Models and Saving View Data to Locked Models

Saving Report Data to Locked Models

If a report is associated with a locked model and the Enable Save property is set to All Models as shown below, users cannot save data from that report.

newallmodels.png

If a report is associated with multiple models, one of the models is locked, and Enable Save is set to All Models, users cannot save data from that report.

If a report is associated with a model that is locked, Enable Save is set to Calculation Model and Calculation on Save is based on the model that is locked as shown below, users cannot save data from that report.

repdesigncsave.png

If a report is associated with multiple models (some that are) locked, Enable Save is set to Calculation Model, and Calculation on Save is not based on the model that is locked, users can save data from that report to the models that are not locked.

Saving View Data to Locked Models

If Enable Save is set to Yes in a View on a model that is locked as shown below, users cannot save data from that view.

newsetupupdates.png

Functionality that can be used on Locked Models

  • Append
  • Set Display Label
  • Set Dimension-Based Properties
  • Attribute
  • Set Attribute Mapping

How to Unlock a Model?

  1. In SpotlightXL, navigate to the Model >Setup.
  2. Select a Locked model.
  3. Click the Unlock Model action.

Locking and Unlocking Models Using a Calculation

Another way to lock or unlock a model is to select the LockModel or UnlockModel type as a line item in a Calculation. Performing the lock or unlock in a calculation saves time as it automates the process. For example, you might want to unlock a locked model, generate a formula, run aggregation, and then lock the model once again. If this is the case, your Calculation might look like the following:

ModelingImagesimage261.png

How to Lock or Unlock a Model Using a Calculation?

  1. In SpotlightXL, navigate to the Model task and the Calculation subtask.
  2. Select the model you want to lock or unlock.
  3. In the Type list box select the LockModel or UnlockModel type as shown below.


Notes:
  • When the Calculation runs, it checks whether the model is locked or not before executing each line item/step. If the model is locked, the calculation will be terminated and you will be notified.

Important Note:

Spotlight Error Message: "Cannot update dimension members. Model Status should be Not Generated or Locked"

This message indicates that you are attempting to update a model’s dimension (e.g., appending or modifying members) while the model is in a Generated state. Updates to dimensions are only allowed when the model is in either a Not Generated or Locked state.

How to Resolve

You have two options depending on the type of changes you are making:

Lock the Model

Use this option if you are adding or modifying dimension members without clearing model data.

  1. Navigate to Model > Setup.
  2. Select the relevant model.
  3. From the Actions toolbar, choose Lock Model.
  4. Go to Model > Dimension and make your updates.
  5. When finished, Unlock the model and re-run any required aggregation calculations.

Clear the Model

Use this option for structural changes, such as:

  • Adding or removing dimensions
  • Changing dimension types (Key vs. Value)
  • Modifying parent or root-level structure
  1. Navigate to Model > Setup.
  2. Select the model.
  3. From the Actions toolbar, choose Clear Model.
  4. This action removes all data, but retains dimensions and structure.
    Note: Make your dimension updates as needed.
  5. Regenerate and aggregate the model when complete.

Best Practice

Always back up your model before performing a Clear Model action.

  1. Go to Manage > Application Administration > Model Backup/Restore.




Was this article helpful?