Creating relationships with roles

Say I have 2 entities (showing entity/table and attribute/column names):

"Date Dimension"/D_DATE. Primary key = "Date SK"/date_sk

"Transaction Fact"/F_TRANSACTION. Attribute = "Keyed Date SK"/keyed_date_sk

How do I create a relationship between these two attributes via a macro?

I've tried using the AddWithRoleName function but I cannot get it to work - probably because I do not know how to create the PKPairList value correctly

Just to be clear, I want to create a relationship where the parent = D_DATE.date_sk and the child = F_TRANSACTION.keyed_date_sk


No Data
  • I don't know whether you solved your issue, but I was also struggling with this.  I found the answer when I clicked the "?" button on the browse objects window for Relationships.  It brings up a bigger help window which has notes on the PKPairList syntax and rules.  The basic format of the PKPairList argument is a string of the format "PKname1,Rolename1;PKName2,Rolename2", etc..  There are some limitations and I've just started experimenting.  I can at least get it to create a new relationship, though I think in my case it will not work because I am trying to use an alternate unique index.  Oh well.  Hopefully it helps you.