Tabular model - how to add a relationship between two tables using AMO RRS feed

  • Question

  • Hello,

    i just go throw the AMO2Tabular example project and i have to build a relationship between two tables.

    How do i do that pragmatically with AMO?

    Maby a simple example: A self generated DateTime table (dimension) and a second table that has a DateTime column must be linked with a column in the DateTime table.

    Where can i find information how to do this?

    • Edited by thanei Wednesday, September 7, 2011 11:03 AM
    Wednesday, September 7, 2011 10:59 AM

All replies

  • I have downloaded and was playing around with the AMO2Tabular project and after overcoming many configuration issues, we got this project to compile and work all the way through building the cube and placing it on a Vertipaq server.  What we noticed is that the AMO code doesn't seem to auto create a relationship between the 2 tables you selected.  For instance I chose the DimProduct and the FactInternetSales tabel from the Sample AdventureWorks DW database and tried it 2 different ways with the same results.  One way I did not choose the ProductKey from either table.  The other way I chose the ProductKey from both tables and both times when I go to browse the cube I see both tables listed as dimensional.  I also see a No measures defined message in the measures section.  in looking at the code I would expect the relationship to be built when the datasource view is created. 

    Can anyone confirm this?  Is it that the code example is not 100% complete and this is indeed missing.  If so is there an example in AMO code on how to create the relationship?  So far this is the only coding example I have seen for AMO and Vertipaq / Powerpivot cubes.  I would love to see more if there is any out there.  Any information would be helpful.  We are trying to do a POC for programmatically creating an in memory Vertipaq cube and have it hosted on a server that users can access via excel.



    Wednesday, October 12, 2011 9:12 PM
  • I got this answer from the following posting I submitted to teh MSDN blogs from JuanPablo Jofre, a programming writer.  Hope this helps....

    Analysis Services and PowerPivot Team Blog

    Creating a Tabular Model with AMO


     JuanPablo Jofre

    21 Oct 2011 8:11 AM

    The sample is being updated for the next release of Denali. Some bugs in the CTP3 version are fixed and new features were added, creating relationships the most important. I'll look for ways to help without hindering the next release of the sample.

    Best regards,

    JuanPablo Jofre

    Programming Writer for the AS team at Microsoft

    Wednesday, October 26, 2011 6:16 PM
  • Has there been any progress on this?

    The latest availble bits I can find are on connect SQLServer2011-KB2589500-x64. For some reason there are two entries with the same filename dated 8/18 and 9/28.

    Saturday, November 12, 2011 1:30 AM