# How to model inventory in an ERP

**URL:** https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158
**Category:** Data Vault 2.0
**Tags:** business-key
**Created:** [February 7, 2022, 7:48pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158 "2022-02-07T19:48:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Nat](https://avatars.discourse-cdn.com/v4/letter/n/8c91f0/32.png) [@Nat](https://forum.data-community.org/u/Nat)
#### Post date: [February 7, 2022, 7:48pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/1 "2022-02-07T19:48:44Z")

</div>

Hi  
Hope you can help

We’re trying to model inventory in a (number of) warehouses in data vault.  
Each inventory position is based on a SKU, a batch numnber, a location (for example a warehouse or a transportation route), and a status (in stock, quarantined etc) at a particular point in time as well as all the values.

A batch can contain multiple SKUs so the business key is basically SKU x Batch ID.

We get from the source the full snapshot of the inventory each night - we have a complication in that the source system does not record deletions or zero-outs (it just removes the record, leaving no ‘end date’) and we don’t have a CDC so we can’t do this.

What I think we have is  
hub : SKU\_bk, Batch\_ID\_bk, ++ bk\_hash ++ other hub stuff  
sat: bk\_hash, location, status, number units, (some other descriptive stuff) ++ other sat stuff

What I don’t understand is how to get the inventory as of today - especially given the restrictions on the source system as we can’t have a snapshot date as part of the hub BK and there is no end date on any satellites, meaning that if a position is deleted rather than zeroed out, deleted records will remain in the effective view in the satellite.

does this make sense? (allowing a snapshot date as part of a BK would be helpful but realise this isn’t allowed)

---

<div class="post-metadata">

### Author: ![will.list](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/will.list/32/27_2.png) [@will.list](https://forum.data-community.org/u/will.list)
#### Post date: [February 8, 2022, 9:44am UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/2 "2022-02-08T09:44:13Z")

</div>

I believe Dan touches on this type of scenario in the core book. He proposes the solution of recording a ‘last seen date’ and then running a business rule on the satellite at an appropriate interval to add a ‘considered to be ended’ date in lieu of a definite end date.

If you are very sure of your source, you could implement this as “If an item hasn’t been seen today, give it an end date of today”. In case of reporting error, you could implement this as “If an item hasn’t been seen for a week, give it the end date that it was last seen”

---

<div class="post-metadata">

### Author: ![Nicruzer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/nicruzer/32/38_2.png) [@Nicruzer](https://forum.data-community.org/u/Nicruzer)
#### Post date: [February 8, 2022, 5:54pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/3 "2022-02-08T17:54:44Z")

</div>

Expanding on @will.list 's answer, Dan indeed does cover “Last Seen Date” in his _Building a Scalable Data Warehouse with Data Vault 2.0_ book, starting at page 100 in the section titled **4.3.2.5 Last Seen Date**. Chapter 11 of the same book discusses how to populate these dates.

The section mentions that this can be done when the

> [@Building a Scalable Data Warehouse with Data Vault 2.0 (4.2.3.5)](#):
>
> source systems provide a full table dump of all the records currently available in the operational system.

Do you receive a full load each time from the source system?

---

<div class="post-metadata">

### Author: ![patrickcuba](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/patrickcuba/32/19_2.png) [@patrickcuba](https://forum.data-community.org/u/patrickcuba)
#### Post date: [February 8, 2022, 10:53pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/4 "2022-02-08T22:53:20Z")

</div>

Last\_Seen\_Dates are deprecated as of the DV2.0.2, although they would be handy on Snowflake [https://patrickcuba.medium.com/data-vault-agility-on-snowflake-747a04485499](https://patrickcuba.medium.com/data-vault-agility-on-snowflake-747a04485499)

---

<div class="post-metadata">

### Author: ![Nicruzer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/nicruzer/32/38_2.png) [@Nicruzer](https://forum.data-community.org/u/Nicruzer)
#### Post date: [February 9, 2022, 1:23pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/5 "2022-02-09T13:23:31Z")

</div>

Thank you, @patrickcuba, for the update on the last seen date deprecation. Naturally, I decided to do a little digging myself on this as well.

I found **[an interesting post from Dan that references last seen dates and load end dates](https://danlinstedt.com/allposts/datavaultcat/end_of_updates/)**, calling them dead because they involve updates in the data vault.

To implement a 100% insert only solution instead, he recommends:

> [@Updates in Data Vault are DEAD! Finally | Accelerated Business Intelligence (danlinstedt.com) (https://danlinstedt.com/allposts/datavaultcat/end\_of\_updates/)](#):
>
> 1. implement record source tracking as defined in my book: [building a scalable data warehouse with data vault 2.0](https://www.amazon.ca/building-scalable-data-warehouse-vault/dp/0128025107), or as defined in my cdvp2 class. what??? you’re not yet certified? why? what’s stopping you? i am offering two additional courses this year, you can sign up for them at: [http://datavaultalliance.com](http://datavaultalliance.com/)
> 2. implement point in time and bridge tables – and do it properly!!! again, as defined in my book: [building a scalable data warehouse with data vault 2.0](https://www.amazon.ca/building-scalable-data-warehouse-vault/dp/0128025107), or in my cdvp2 class.

Section 5.3.5 of Dan and Michael’s book _(Building a Scalable Data Warehouse with Data Vault 2.0, pg. 146-149)_ discusses record source tracking. The beginning of chapter 6 discusses PIT tables.

---

<div class="post-metadata">

### Author: ![patrickcuba](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/patrickcuba/32/19_2.png) [@patrickcuba](https://forum.data-community.org/u/patrickcuba)
#### Post date: [February 9, 2022, 10:32pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/6 "2022-02-09T22:32:14Z")

</div>

Yea because they’re expensive — my article above has a link to the standards themselves DV2.0.2

---

<div class="post-metadata">

### Author: ![RhysHanscombe](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/rhyshanscombe/32/394_2.png) [@RhysHanscombe](https://forum.data-community.org/u/RhysHanscombe)
#### Post date: [November 25, 2025, 3:59pm UTC](https://forum.data-community.org/t/how-to-model-inventory-in-an-erp/158/7 "2025-11-25T15:59:39Z")

</div>


