1 Reply Latest reply on Jun 25, 2018 6:30 AM by Jay Morehart

    Error when trying to join two tables

    Johanna Olnen


      I am trying to join two tables where the member id in tracking_entity is equal to the id in member_entity. All of the values in tracking entity also exist in member-entity but all the values in member entity do not exist in tracking entity. When I try to do this I get an error message that I don't really understand. Is there anyone who knows what's wrong with this join?




      Skärmavbild 2018-06-25 kl. 14.43.06.pngSkärmavbild 2018-06-25 kl. 14.43.45.png

        • 1. Re: Error when trying to join two tables
          Jay Morehart

          This error is coming from your DB it looks like. It looks like you are trying to compare 2 different data types. I would guess that `member_id` is your varchar (character varying) and that id is your bigint

          It looks like you are connecting to a postgres DB, all of my postgres DBs appear to use text and citext rather than varchar (both of which join without errors to bigint) so I cannot test your exact case. What version of Tableau are you using? after 10.2 we can use join calculations. there are a few things you can try

          1. change which ever field is the varchar (string in Tableau) to "Number (Whole)" and see if it will let you join (or change the number to string, but if your string contains  leading 0s the join will not work

          2. create a join calculation and cast your text field to an int: int(member_id)



          3. either of the above should work, but in the event that they do not, you could try a custom SQL statement, you should be able to work with your DBA if you are unfamiliar with the syntax


          Hope this helps!