2 Replies Latest reply on Feb 26, 2017 10:55 PM by Alex Marlow

    Help with data relationship

    Alex Marlow

      Hi, I need a little help creating a relationship between two data sources. Attached below is my Tableau workbook. In the "Winning candidates" tab, I need to have a relationship between 2010 US House & Senate Results (Winners) & Independent Expenditures. The issue is that the data within the independent expenditures tab is inconstant. Not all of the Can IDs are listed so I am unable to match that with the Fec ID# in 2010 US House & Senate Results (Winners).

       

      I tried working with the candidate names, but they also tend to flip back and forth with last name & first name.

       

      Thanks for you help in advance!

        • 1. Re: Help with data relationship
          Christina Gremore

          Hi Alex,

           

          Unfortunately, the solution to this is going to be pretty manual. If you can't edit the data in the database (which is what I'd recommend when you have data hygiene issues to this extent) you can at least fake it with groups.

           

          For instance, in your Independent-Expenditures data source, you have three values for the candidate Dan Lungren: LUNGREN, DAN ; LUNGREN, DANIEL, and LUNGREN, DANIEL E.Use the grouping feature to group all three of these values together, and then right-click on the new value (which will look like all three names concatenated together) and then select "Edit Alias," and rename the alias LUNGREN, DAN, or whatever it is in the 2010 US House & Senate data source. Then edit your data relationships to have the linking field be between the "Candidate Names capitalized" field in your primary source and the "Candidate name (group)" field in your secondary source. (If you're not entirely sure what I'm talking about, check out this link: Blend Your Data . Scroll down to where it says, "Step 4: (Optional) Define or Edit Relationships")

           

          The fastest way to do this is with a dashboard and a wildcard filter, I'd say. I've set one up for you in the attached workbook - type the last name of a Winning Candidate in the text box at the top (capital letters), hit enter, then see what comes up in the Sheet 8 below. Group together the appropriate values, and then edit the alias to match what it is in the primary data source.

           

          If this resolves your issue, please mark this question as answered.

           

          Christina

          1 of 1 people found this helpful
          • 2. Re: Help with data relationship
            Alex Marlow

            Hi Christina,

             

            Thank you so much for your help! I do see what you mean and I was afraid of the manual process. This is actually governmental data from the fec.gov website so any modifications would have to be done within Excel. I have figured out another way with different concepts and maybe you could take a look at that for me. Here is the link: Setting Measures to Another

             

            I am going to mark this questions is answered - thanks again!