Question about weird issue…Join Types ?

  • Question about weird issue…Join Types ?

    Posted by Robert Jolliffe on March 26, 2021 at 1:13 am
    • Robert Jolliffe

      Member

      March 26, 2021 at 1:13 AM

      I solved this issue but I have no idea how.

      I have 2 tables

      Table 1 has a field that is either Invoice or Credit, and a field with a Document No.Ā  I concatenated the 2 fields to create a new one called Doc No. Type
      EG:
      AmountĀ  Ā TypeĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Doc No.Ā  Ā Doc No. Type
      $100Ā  Ā  Ā InvoiceĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā 101Ā  Ā  Ā Invoice-101
      $200Ā  Ā  Ā InvoiceĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā 202Ā  Ā  Ā Invoice-202


      The second table has similar fields

      DateĀ  Ā  Ā  Ā  Ā  Ā Other DataĀ  Ā  TypeĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Doc No.Ā  Ā Doc No. Type
      01-01-2021Ā  Ā  Ā AĀ  Ā  Ā  Ā  Ā  Ā  Ā  InvoiceĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā 101Ā  Ā  Ā Invoice-101
      01-15-2021Ā  Ā  Ā BĀ  Ā  Ā  Ā  Ā  Ā  Ā  InvoiceĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā 202Ā  Ā  Ā Invoice-202
      01-17-2021Ā  Ā  Ā CĀ  Ā  Ā  Ā  Ā  Ā  Ā  InvoiceĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā 202Ā  Ā  Ā Invoice-202
      01-21-2021Ā  Ā  Ā DĀ  Ā  Ā  Ā  Ā  Ā  Ā  PaymentĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā 303Ā  Ā  Ā Payment-303

      When I create a 1:n join between Table 1 and Table 2 – and add a field from Table 1 to a “Table” visualization, all is fine.Ā  When I added a field from Table 2 – all records cleared and no data was visible.

      As I played around sometimes the payment was visible, sometimes nothing etc…

      So I started a new tab and dragged in the fields from Table 2 and started adding Table 1 just to see what would happen.Ā  That worked fine.Ā  I can rearrange the fields to the exact order I wanted to.

      Does anyone have any idea why this happened?Ā  It is essentially an outer join as Table 2 has records in it that aren’t n Table 1.Ā  I am a little confused by the join types in Power BI modelsĀ  – I’m an old hand at SQL but I do find the limits of not being able to use compound keys very limiting and the cross filters etc…Ā  Could that be what the issue is?Ā  Is there a primer on this stuff for someone who knows SQL?

      Maybe I should do this in the the power query as merging queries and expanding Table 2 … maybe do this with transformations not in the model relationships?Ā  I just really don’t want to have to do magic to get the SUM of the invoice 202 as I would probably end up with a new query where it shows 2x where the 2 are merged into 1.

      Thanks in advance!

      -Rob

      ——————————
      Robert Jolliffe
      President
      Sabre Limited
      Cambridge, Ontario Canada
      5195857524
      ——————————

    • William Skelley

      Member

      March 26, 2021 at 3:24 PM

      Hi Rob:

      There are all sorts of table functions for you to use. Summarize, Summarize Columns, CROSSJOIN, Intersect, etc.Ā 

      If you have an example of some tables and the result you are seeking I can try to help. It’s great to have the data to work with.

      Thanks,

      Bill

      ——————————
      William Skelley
      01106
      Longmeadow MA
      8602807221
      ——————————
      ——————————————-

    Robert Jolliffe replied 5 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Question about weird issue…Join Types ?’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!