# Verifying a Dimensional Model

The process of verifying a dimensional model in Astera Data Stack is the same as that for a general data model. To learn more about verifying a general data model, click [here](https://documentation.astera.com/astera-data-stack-v10/data-model/data-models/verifying-a-data-model).

In this article, we’ll cover a few common errors and warnings that you may encounter while verifying a dimensional model.

### Common Verification Errors and Warnings

#### Case 1: Insert Only

In this case, we have a data model that contains one dimension entity called *SCD\_Customer*.

![01-verification-dimensional-model-case1](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FAYAKmoNsbWgBFnUOCvVx%2F01-verification-dimensional-model-case1.PNG?alt=media\&token=c5114f42-eb41-4f6d-a696-8d18fee05e41)

Here is the layout of this entity.

![02-case1-dimension-entity-layout](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FnF86b8LSgeqnD6hOG5aG%2F02-case1-dimension-entity-layout.PNG?alt=media\&token=81f9bea5-1b07-426d-aa35-742a04813318)

You’ll notice that the *Dimension Role* for all of the fields is *Insert Only*. However, you need to assign a business key, SCD types, and other SCD-related roles to certain fields in a dimension entity.

Upon verifying for read and write deployment, the *Verify* window will display the following errors:

![03-case1-dimensional-verification-errors](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FAdgtFjHpXVJvZ10OoXLd%2F03-case1-dimensional-verification-errors.PNG?alt=media\&token=d9c725e4-5560-456a-9a43-45eee46b883e)

The first error indicates that the entity must contain at least one SCD element.

The second error indicates that the entity must contain a business key.

**Solution**: Go to the *Layout Builder* screen and assign appropriate *Dimension Roles* to certain fields. Here is a look at the entity layout after we have done so.

![04-case1-dimension-entity-roles](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fog7Wvoo2dz4eUvAft1IH%2F04-case1-dimension-entity-roles-1616595944062.PNG?alt=media\&token=96615b26-ac8c-4814-88e8-5b6da6becb18)

As you can see, the entity now contains a business key and three SCD1 elements.

Once you’ve defined the dimension roles, click *OK*. The model can now be verified successfully.

#### Case 2: Record Identifiers

Here, we have a modified version of the data model used in case 1.

![05-verification-dimensional-model-case2](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FBcHE1fc7puMdCHMWtdjh%2F05-verification-dimensional-model-case2.PNG?alt=media\&token=da5cda41-5c39-4798-893c-4de4f51a5461)

In this case, the layout of the *SCD\_Customer* entity contains an SCD2 element but does not contain any record identifiers.

![06-case2-dimension-entity-layout](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FrrxA9mzGCnbjb4wePM3g%2F06-case2-dimension-entity-layout.PNG?alt=media\&token=4a23c28f-4bc8-4ffb-b439-d1cd89e71237)

Upon verifying for read and write deployment, the *Verify* window will display the following error:

![07-case2-dimension-verification-error](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FflvVdNlxr1knh3CZJlbD%2F07-case2-dimension-verification-error.PNG?alt=media\&token=5db55076-8c11-419e-b3bd-cc04d9d2b520)

The error states that the *SCD\_Customer* entity contains a SCD2 or SCD6 element but does not have any active row identifiers.

**Solution**: Go to the *Layout Builder* screen and assign a record identifier field. In this case, the entity layout already contains a field that denotes the *Version Number* (*VersionNo*). We’ll use the *Dimension Role* dropdown menu to assign the *Version Number* role to the field named *VersionNo*.

![08-case2-dimension-role-identifier](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FYpAcrflkmlAdjkVy4Kvf%2F08-case2-dimension-role-identifier.PNG?alt=media\&token=6b952e4d-ff64-4729-95ec-5db53550e17d)

The model can now be verified successfully.

#### Case 3: Record Identifier Not Needed

Here, we have another modified version of the model in cases 1 and 2.

![09-verification-dimensional-model-case3](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FQ4KpexnY4NZIvuubg9dO%2F09-verification-dimensional-model-case3.PNG?alt=media\&token=c2d3ab27-13a4-4697-a567-834e68b7ee3b)

The layout of the *SCD\_Customer* entity contains a business key, an SCD1 element, and an *Effective Date* record identifier.

![10-case2-dimension-entity-layout](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FLEpSc5s5hGZasVyn5DnD%2F10-case2-dimension-entity-layout.PNG?alt=media\&token=d1ebc0a1-8c0a-488b-981e-ef439e575f9b)

However, a record identifier is only needed in the layout when it contains at least one SCD2 or SCD6 element.

Upon verifying for read and write deployment, the *Verify* window will display the following warning:

![11-case2-dimension-verification-warning](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FzWVwSBboFPVkLtyf5p6q%2F11-case2-dimension-verification-warning.PNG?alt=media\&token=998dcc39-868d-4aa8-b4c3-da8e345103a6)

{% hint style="info" %}
**Note**: A warning is not the same as an error. When a model contains one or more warnings, it can still be deployed or forward engineered. However, it is a good practice to remove warnings before you move forward.
{% endhint %}

This warning indicates that the layout contains an effective or expiration date which serves no purpose since it does not contain an SCD2 or SCD6 field.

**Solution**: Go to the *Layout Builder* screen and delete the *EffectiveDate* field by right-clicking on the field and selecting *Delete* from the context menu. However, if you wish to add an SCD2 or SCD6 element to the layout, do not delete the field.

![12-case3-delete-field](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F8m4sFU9dQwbICx1jTwgF%2F12-case3-delete-field.PNG?alt=media\&token=b4a37d0d-92e7-4a75-b102-7041c0202aad)

The model can now be verified successfully.

This concludes our discussion on verifying a dimensional model.
