Prepare Instances may be able to execute tables in the correct order by default, which normally results in dimension tables being executed before fact tables and ensures that the foreign keys in the fact tables are valid. However, if your Prepare Instance contains custom scripting, such as custom views, table inserts, pre-scripts, or post-scripts, then the default TimeXtender Execution behavior may not necessarily execute all of the dimension table and views before executing the fact tables, which may result in some of the foreign key values in the fact table being null.
An easy way to ensure that tables are executed in the correct order is to setup Object Dependencies on the tables that require other tables or views to be executed prior to their own execution.
The following example shows how to set up Object Dependencies on a fact table that requires other dimension tables to be executed prior to its own execution.
- Review your Fact table and identify all of the Dimension tables that may be related to it.
- Right-click on your Fact table and select Advanced → Object Dependencies.
- In the Object Dependencies dialog, check the boxes next to the appropriate dimension tables and views that are related to the Fact table.

After setting up the Object Dependencies above, execute the Prepare Instance and confirm that the Fact table is exeucted after all of the dimension tables.

