# How do you deal with missing dimensions for foreign keys?

**URL:** <https://discourse.getdbt.com/t/how-do-you-deal-with-missing-dimensions-for-foreign-keys/1274>\
**Category:** In-Depth Discussions\
**Created:** [June 15, 2020, 5:57pm UTC](https://discourse.getdbt.com/t/how-do-you-deal-with-missing-dimensions-for-foreign-keys/1274 "2020-06-15T17:57:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![josh](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@josh](https://discourse.getdbt.com/u/josh)\
**Post date:** [June 15, 2020, 6:14pm UTC](https://discourse.getdbt.com/t/how-do-you-deal-with-missing-dimensions-for-foreign-keys/1274/2 "2020-06-15T18:14:02Z")

</div>

We still create a “-1” “Unknown” row in our dimensions. Although it’s not actually “-1” literally, it’s the hash of “-1”. And then we have a variable in our dbt\_project.yml file like this:

` unknown_key: "CAST(FARM_FINGERPRINT('-1') AS INT64)"`

Then when we build our fact tables and need to populate the keys to join to the dimension tables, we do something like this:

```
COALESCE(pers.person_key, {{ var('unknown_key') }} ) AS person_key,

```

I never really thought of one of the primary benefits of hash keys as being able to load dimensions and facts in parallel per se.

---

_[View the full topic](https://discourse.getdbt.com/t/how-do-you-deal-with-missing-dimensions-for-foreign-keys/1274)._
