2 Replies Latest reply on Dec 3, 2012 10:43 AM by Alex Kerin

    Custom Relationships - is this right?

    Alex Kerin

      I often use data blending and it usually has to be custom. I'm not sure why when I define a relationship I then have to go back and define each of the date aggregations as well. I would have expected this to be done automatically. Here I have connected Shift Start to Datetime. Do I really have to go back and define MDY(Shift Start) is connected to MDY(DateTime), Year(Shift Start) to Year(DateTIme), and so on? Or am I doing this wrong?

       

      relationships.png

        • 1. Re: Custom Relationships - is this right?
          Jonathan Drummey

          Hi Alex,

           

          I'd promised myself not to answer any more questions this morning, but then you posted.

           

          My workaround for this to first-thing create a calculated field in the secondary that returns the secondary's date field, and give the calc the same name as the field in the primary, then Tableau will automatically generate all the relationships. So in your case in the Sales Data, you'd create a "Shift Start" field with the formula [DateTime].

           

          I don't know why Tableau requires all the relationships to be explicitly defined, my only guess is that dates aren't just one dimension, they encompass a lot of aggregations and the Tableau developers didn't want to hide that and remove some functionality for some use cases, like where you'd want to do a self-join of monthly data to annual results, which was apparently a lot more necessary in the days before custom table calcs.

           

          Jonathan

          • 2. Re: Custom Relationships - is this right?
            Alex Kerin

            Yep, great answer - it actually prompted me to do a lot of renaming so that it was picked up automatically.