How do you create a relationship with date table in SQL Server Data Tools

Posted on 2014-08-18
Last Modified: 2014-08-24
I am using SSDT 2012 to create a tabular model. I have several tables (Order, Order Details, Delivery Details, Item Details etc.) All of these are working fine. I have created relationships between these tables and I can sort and sum my data. My issue however is creating and assigning the date table. I created a data table with many date columns (Date, Month Name, Year, FY etc.) but I cannot get this table to work with all the others. I assigned it as the date table and marked the date column. Then when I do a report and select FY 2015, if gives me every order from the order table. If I create a relationship between the Date field and the Order date field, then it works. However, I cannot have another active relationship with the delivery date and Date field. So in short, how to I make the date table work with all the other table's date field?
Question by:jsgrosskopf
    LVL 47

    Expert Comment

    Are you after how to do this in SSDT, or are you after how do yo do this in SQL?

    Please provide the table and field names.

    {+ edit} btw: I don't use SSDT so all I can offer s the SQL
    sample data and expected result would greatly assist too.
    LVL 100

    Expert Comment

    I don't use that tool either but the normal way to do that is to add a copy of the date table for each date you need to use it with.

    LVL 31

    Expert Comment

    Haven't tested this with SSDT 2012, but I do it as advised by Kimball: Each date column points to a semantically different dimension. Cause they have the same values, create one complete base date dimenension table. Create views of it to get the semantics. Build the relationships to the according views.

    Accepted Solution

    I finally found this out, there is a calculation you can do in the date table with the "userelationship" variable and all my relationships work. Thanks for all the responses.

    Author Closing Comment

    Solution was found. Thanks for all the comments helping me

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now