Please note that there are rows in the RiskVersion table where there is either no InsuredID, ReInsuredID or Both. The Primary Key for this table is the RiskID. Whilst the Foreign Keys are InsuredID and ReInsuredID
I then load an Insured table which joins to the to the RiskVersion Table on InsuredID and I use a Right Join as I want all rows from the Insured Table. The load on Qlikview looks as below:
Once these two tables have been loaded into Qlikview, I present a table box made up of the RiskReference from the Riskversion table and a few fields from the Insured Table. As I expect the number of rows returned is exactly what im after.
I next load the ReInsured table. This again joins to the RiskVersion table on ReInsuredID and Is a Right Join as I want all records from the ReInsured Table. The load is as follows:
If I now try to present a table box with the RiskReference from the RiskVersion table and some fields from the ReInsured table. The number of records returned is incorrect and the number of records in the Insured Table Box also changes to an incorrect number.
By using right joins you create one table that has records for every InsuredID and every ReInsuredID even if there were no corresponding records in RiskVersion. That's what right and left joins do. I guess that's probably not what you expected. See http://community.qlik.com/thread/39177 for some more information.