# PII data for Business Keys

**URL:** <https://forum.data-community.org/t/pii-data-for-business-keys/488>\
**Category:** Data Vault 2.0\
**Created:** [November 3, 2022, 11:06am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488 "2022-11-03T11:06:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [November 3, 2022, 11:06am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/1 "2022-11-03T11:06:55Z")

</div>

Another day, another challenge.

I have my _h\_party_ with its BK being _party\_id_, sourced from our golden source (let’s call that source GS) table Party, column PartyId.

Now, I need to load external credit ratings coming from another source (ECR), that are tied to a LEI\_code (the globally known Legal Entity Identifier). This LEI\_code is stored in a different GS table named PartyExternal, with a composite BK of PartyId+ExternalIdType, with attribute ExternalIdValue.

One of those ExternalIdTypes is LEI, so that ExternalIdValue is how I can link my external credit ratings to a Party.

Now, this PartyExternal table contains all sorts of Types, some of them being BIC, CoC, VAT, but also Driver’s License Numbers, Passport Numbers and Identity Card Numbers. All of which are very PII sensitive and should be masked.

How should I model this table?

- Can I just take the LEI codes (both from GS and ECR), load them into h\_party and create a same-as-link? I won’t be able to recreate the source because I’m not loading all the data. And what if at a later stage I decide to load an additional ExternalIdType for which the ExternalIdValue can clash with an existing party\_id?
- Create a h\_lei with a link to h\_party? Will I then have to create new hubs for every additional ExternalIdType?
- Create h\_party\_external with composite BK of party\_external\_id + party\_external\_type? When sourcing this from the ECR table, I would have to hardcode the value ‘LEI’ into party\_external\_type because I only get the LEI\_code (which implies the party\_external\_type is ‘LEI’). If I decide to load all ExternalIdTypes, I will have to mask the ones that are PII sensitive. Can you even mask only certain values, based on a condition, in one particular column?
- Create a mas\_party with ExternalIdType as a DCK. Perhaps make two, one with PII data where I can more easily mask ExternalIdValue and one where no masking is needed (meaning I’d have to filter on ExternalIdType in staging). But then I’d still need to know what to do with the ECR table?

These are some possible solutions I can think of… any help is greatly appreciated!

edit: something to keep in mind: we’re going to implement BK treatment because the party\_id should always have 12 characters with leading zeroes (a legacy source delivered them without leading zeroes).

---

<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:** [November 4, 2022, 5:29am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/2 "2022-11-04T05:29:10Z")

</div>

Sounds complex…

- deal with the tech debt by splitting the data upon staging,

- if the keys are embedded then split those out too

Question is, can the source provide that for you instead then you don’t need to do/maintain that splitting yourself.

Don’t let the DV become the repository of tech debt.

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [November 4, 2022, 8:09am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/3 "2022-11-04T08:09:30Z")

</div>

Thanks for the reply Patrick. But I’m still struggling with what DV objects I should be splitting them into.

Unfortunately, the source won’t be of any help here.

---

<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:** [November 4, 2022, 10:36am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/4 "2022-11-04T10:36:24Z")

</div>

But you have PII with non-PII identifiers… somewhere the ids must be split **before** ingest.  
Imagine if you’re building a source system and decide to use PII ids as PKs… that means the DB’s integrity is based on PII … = disaster when Article 17 is exercised.

What this means is that these ids should never be loaded to hub tables; they’re locked away in PII sats.

Source should split for you unless unfeasible to do so. Regardless of PII or not PII the splitting must happen before entering DV. Because if you allow this entanglement to be managed by building more tables in your DV model it means you have more and more tech. debt handled by SQL joins.

Your aim should be less DV tables, not more.

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [November 4, 2022, 11:28am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/5 "2022-11-04T11:28:46Z")

</div>

So then the DV model could look like this (sorry for the text… I should really get a visualisation tool).

Staging:

- Party
- ExternalCreditRatings
- PartyExternalNonPII (filtering on ExternalIdType)
- PartyExternalPII (filtering on ExternalIdType)

RDV:

- h\_party: BK party\_id with mappings:
  - Party.PartyId
  - PartyExternalNonPII.PartyId
  - PartyExternalPII.PartyId

- h\_party\_external: BK party\_external\_id + party\_external\_type with mappings:
  - PartyExternalNonPII.ExternalIdValue + PartyExternalNonPII.ExternalIdType
  - ExternalCreditRatings.LEI\_code + hardcoded value that matches with the LEI equivalent in ExternalIdType

- l\_party\_external\_party: BK h\_party\_external\_hkey + h\_party\_hkey with mappings:
  - PartyExternalNonPII.ExternalIdValue + PartyExternalNonPII.ExternalIdType + PartyExternalNonPII.PartyId

- s\_party\_external\_credit\_ratings with mappings that match the mapping to h\_party\_external:
  - ExternalCreditRatings.LEI\_code + hardcoded value that matches with the LEI equivalent in ExternalIdType

- mas\_party\_pii: BK party\_id + party\_external\_type with mappings:
  - PartyExternalPII.PartyId + PartyExternalPII.ExternalIdType
  - Masked attribute mapped to PartyExternalNonPII.ExternalIdValue

Hoping this is readable and understandable 😊

---

<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:** [November 5, 2022, 12:04am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/6 "2022-11-05T00:04:35Z")

</div>

Your party\_type could be a dependent-child key in a satellite… hub\_party would be all parties because by definition they are the party — external or not they’re still parties.

Yes… get a visual tool 😛

have you tried this free stencil? [the\_data\_must\_flow/stencils at master · PatrickCuba/the\_data\_must\_flow · GitHub](https://github.com/PatrickCuba/the_data_must_flow/tree/master/stencils)

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [November 5, 2022, 10:55am UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/7 "2022-11-05T10:55:54Z")

</div>

I’ll do some analysis on Monday, there are dozens of different party types and I think there will be quite some collisions, not just between the external types but also between the external types and my ‘main’ party id. Besides, I’m doing LPAD(id,12,‘0’) BK treatment that I prefer to do on the column-level, not on the column-mapping-level.

Haven’t tried the stencil yet, but will give it a go, thanks! Just tried importing it into [diagrams.net](http://diagrams.net) and noticed some of the shape texts were aligned to the left too much, making them overlap with the shape image. But I think I can make it work.

---

<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:** [November 6, 2022, 9:08pm UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/8 "2022-11-06T21:08:22Z")

</div>

Hmmm you could never guarantee ids from external providers if there are thousands of them — you’d have the same issue if they were in the same hub or seperate hub.

1. You’d need a mapping table for BKCC per source system, build an error trap for stopping the pipeline when a new source is detected that hasn’t been profiled yet
2. You could also restrict the loads to external parties you care about
3. Or, this is something we did at a debt collection customer. The customer had their own account ids that will clash so we had an internal system assign a debt id to each account id from each external account id. The external id became merely an attribute to a satellite table and the debt id the unique id we used in our DV.

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [November 6, 2022, 9:25pm UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/9 "2022-11-06T21:25:25Z")

</div>

I have already considered your point 2… But then I won’t be able to recreate the source. How bad would that actually be in this case?

---

<div class="post-metadata">

**Author:** ![tberla](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@tberla](https://forum.data-community.org/u/tberla)\
**Post date:** [November 9, 2022, 1:35pm UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/10 "2022-11-09T13:35:19Z")

</div>

Seems to me that Patrick has put his finger on the real problem: the ECR source is violating PII standards by mixing keys that need to be masked with keys that don’t. In your DV, you DO NOT want to repeat that error, so you will segregate them. If that means you can’t fully recreate the source… well, that’s kind of a GOOD thing when the source is not something worth emulating.

The main purpose in being able to recreate the source is to satisfy audit requirements. I think any auditor would understand your unwillingness to make that PII-compromised source re-creatable.

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [November 9, 2022, 5:08pm UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/11 "2022-11-09T17:08:20Z")

</div>

(it’s actually the GS source who is violating PII standards as that one is delivering all the external identifiers… but I get your point)

I think especially your last paragraph is worded in a very nice manner… something that I hadn’t been able to put into words properly myself.

Thank you both for the input! Really really appreciated. I’m lacking a sparring partner currently and this helps tremendously.

---

<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:** [December 1, 2025, 2:44pm UTC](https://forum.data-community.org/t/pii-data-for-business-keys/488/12 "2025-12-01T14:44:19Z")

</div>


