# Fact Table Loader

The *Fact Table Loader* object in the *Data Warehouse* section of the toolbox allows you to write data to a fact table. You can connect to a deployed model and then choose a fact table that you want to write your data to.

In this article, we’ll be taking a look at how you can configure and use the *Fact Table Loader* object in Astera Data Stack.

### Video

{% embed url="<https://youtu.be/f-_0XTFpvQ8>" %}

### Example

Here, we have a sample dimensional model that has been deployed on the server.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FlODdb85K0rknIyfC7Awj%2F01-sample-dimensional-model1.png?alt=media\&token=e32a71fc-d81a-41d2-94c3-3f4fc9ae6fa8)

This model contains four dimension entities, one fact entity, and a date dimension entity. In this example, we’ll be loading data into the *Sale* fact entity using the *Fact Table Loader* object.

### Configuring the Fact Table Loader Object

1. To get the *Fact Table Loader* object from the toolbox, go to *Toolbox > Data Warehouse > Fact Table Loader*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FtEUQMXKc3cyrJ9nOg9xm%2F02-toolbox-fact-table-loader.png?alt=media\&token=771ed2d4-a625-4071-a4b0-6e9f725e585c)

2. Drag and drop the *Fact Table Loader* object onto the dataflow designer.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FTFJHZ7KomngqKH47oWDq%2Fadding-fact-table-loader.gif?alt=media\&token=d8d76d13-9199-4298-8780-c0381de70dd6)

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FDuebIpXDTp78xJnXlYV1%2F03-fact-table-loader.png?alt=media\&token=833bcdf8-b145-46cc-882b-d2d10fd696b9)

This object is currently empty because we are yet to configure it.

3. To open the properties window of the *Fact Table Loader* object, right-click on it and select *Properties* form the context menu. Alternatively, you can double-click on the object.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F4CiCMBwj03DuF2FcUh1r%2F04-fact-table-loader-properties.png?alt=media\&token=85778a87-406b-4555-a153-7e05f2a6a576)

A configuration window will appear on your screen.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FFgfoBBezdJKxBmJ7gAj0%2F05-configuration0window.png?alt=media\&token=494e316a-a4bc-42c3-b34c-1b64328c0b77)

Using this window, you can configure the *Fact Table Loader* object.

4. On the *Database Connection* screen, you’ll notice that the *Data Provider* dropdown menu is limited to just one option: *Astera Data Model*. This option represents the data models that are deployed on the server and are available for usage.

![](https://docs.astera.com/projects/dwbuilder/en/latest/_images/06-astera-data-model.PNG)

Once you’ve provided your Astera Data Stack credentials and a server connection, you can select a deployed model from the *Database* dropdown menu.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FRU35TPKLsqBB3sy7OG5m%2F06-astera-data-model.png?alt=media\&token=6abc5746-cd8b-4643-83d7-f9c44535d936)

{% hint style="info" %}
**Note**: The default username is *admin,* and the default password is *Admin123*.
{% endhint %}

In this case, we’ll select *DW\_Sale*, which represents the dimensional model that we saw earlier.

5. On the *Pick Table* screen, you can pick a table from the fact entities present in the deployed model that you’ve chosen.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FW3piKGRY1ee2HafeQQoR%2F07-database-dropdown.png?alt=media\&token=996b73c3-f5ce-42a7-baf1-b5f34baf4f63)

The *Pick Table* dropdown menu allows you to choose from the fact entities in the model.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FCY6yvYx8Ty8EAhXl4rJh%2F09-pick-table.png?alt=media\&token=a9c206e3-1821-4f98-901b-59ea44ac6b6a)

In this case, there’s only one fact table, titled *Sale*, in the deployed dimensional model. Therefore, we’ll pick that table from the menu.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F2ngH0GeSsEYpwJmRQUT4%2F10-pick-table1.png?alt=media\&token=cb098514-1663-43bb-ad50-f44807e89ff2)

Once you’ve chosen a fact table, click *Next*.

6. On the *Layout Builder* screen, you can view the layout of the entity, including the characteristics and roles of each field. However, you cannot modify the layout of the entity from this screen.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FqLpryN8qivwfKhxpYlp8%2F11-fact-layout-builder.png?alt=media\&token=4a3c2d60-46e5-46be-8545-d89ffb683194)

Click *OK* to close the configuration window.

The *Fact Table Loader* object has now been configured and you’ll be able to see all of the fields in the object layout.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FFCqJY8zJFUI1QeyjnE3Y%2F12-fact-table-loader-object.png?alt=media\&token=bef9b367-85be-406a-bec9-8a7cdcc58d5c)

You can now map the incoming source data to each relevant field.

7. Choose a relevant source object from the toolbox and configure it so as to extract the source data. In this case, we’ll use a *Data Model Query* object to extract data from multiple tables in the source deployment, and then map the relevant fields to the *Fact Table Loader* object.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fjtwd2Ocb2OJ8QXQyRsKQ%2F13-fact-table-loader-dataflow.png?alt=media\&token=7ab00f4b-ad84-484f-b5e7-0164e1187ee5)

To learn more about the *Data Model Query* object, [click here](https://documentation.astera.com/astera-data-stack-v10/dataflows/sources/data-model-query).

You can now run the dataflow to load data into the fact table.

This concludes our discussion on the *Fact Table Loader* object.
