More then one bkey in hub table

Hi Everyone,
Looking for a recommendation to define a HUB table with multiple Business key value?
Is it advisable to define HUB table in DV model?
TIA

Hi!

Can you give us more information please? Generally, a hub contains one business key by definition, as it represents a single concept.

By “Multiple business key” do you mean that you have multiple fields that make up a single business key (e.g. a concatenation / composite key) or something else?

It could also be for example that you have a dependent child situation (similar to this thread)

What you have asked could mean many things so any further insight will be helpful :smile:

Hi Alex,
I mean to say multiple attributes make up a multiple business key like below.

which one is advisable to a define HUB table in model?

create table h_x
( hkey, → sha2(a_bkey,256)
load_dt,
rec_src_cd,
a_bkey,
b_bkey,
c_bkey

)
or
create table h_x
( hkey, → sha2(a_bkey+‘-’+b_bkey+‘-’+c_bkey,256)
load_dt,
rec_src_cd,
a_bkey+‘-’+b_bkey+‘-’+c_bkey as bkey

)

I’m trying to build below DV model.

h_x (HUB table). ----> tl_device_data(TL table)
or
h_x (HUB table) —> link_tble -->tl_device_data(TL table)

To use your syntax, it’s usually a mix of the two:

create table h_x
( hkey, → sha2(a_bkey+‘-’+b_bkey+‘-’+c_bkey,256)
load_dt,
rec_src_cd,
a_bkey,
b_bkey,
c_bkey)

Can I ask are you using any tools, or are you hand-coding? Most tools (especially Data Vault-aware tools) should handle hashing and building hubs according to the standards in a consistent way, so you shouldn’t need to code this yourself :slight_smile:

Hi Alex,

Thanks for reply and suggestion on HUB table.

At present I’m using hand-coding and procurement is going on .

Which one is good approach to define a DV model. I’m new to DV model process.

h_x (HUB table) —> link_tble -->tl_device_data(TL table)

or

h_x (HUB table) ----> tl_device_data(TL table)

Thanks in advance.

If by T_LINK you mean ‘transactional link’, these are generally referred to as “Non-historised” links (or NHL) now.

An NHL usually takes the place of a regular link, so the second option is the standard approach