2 Replies Latest reply on Dec 10, 2015 8:42 PM by Shanaka Gunaratna

    Table join

    Mikey Michaels

      Hello All,

      I hope this message finds you well.

      I admittedly know little about table joins and luckily (or unluckily) my IT staff does them for me. They seem to be stumped on a relatively easy (in my eyes) request. What I'm trying to do is the following:

      • I have software seats in one Excel file and revenue in another
      • I want the revenue to not change when the seats are added.
      • There is a customer name field in both data sources.
      • Once IT links the two files the revenue decreases. It only matches the revenue to the customers that are contained on the both sheets.
      • Do we have to join on customer name for the field to be available?
        • 1. Re: Table join
          Derrick Austin

          Hey Mikey,

           

          Depending on the data, you have two options to fix this issue.

           

          A "LEFT JOIN" may solve the issue. A LEFT JOIN will keep data in the base table that does not have a matching record in the joined table.

          W3 schools has a good explanation of this: SQL LEFT JOIN Keyword

           

          If data in the base table AND data from the secondary table cannot be used as the "master list", you will need to do a subquery that does a SELECT DISTINCT on the customer for both datasources to get a "master list" that contains all of the customers. Then, simply LEFT JOIN in the measures from both tables.

           

          Derrick Austin

          InterWorks, Inc.

          1 of 1 people found this helpful
          • 2. Re: Table join
            Shanaka Gunaratna

            Hi Mikey

            Make the 'revenue' file to your primary data source and then left join with the 'software' file.

            1 of 1 people found this helpful