Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to inner-join two tables because I need a table with records that have matching values in both tables.
Table 1 has 3 columns: A, B, C
Table 2 has 6 columns: C, D, E, F, G, H
My script looks like this:
Table_1:
LOAD A, B, C FROM source1;
Inner Join (Table_1)
LOAD C, D, E, F, G, H FROM source2;
The script executed without any error. However, when I looked at the Data Model Viewer, the columns were there without any data.
I have no idea what I did wrong.
Thank you for your help in advance.
I was able to solve it after using Num#() function on both C columns. I was using Num() function before and after switching to Num#() function, I didn't use it on both columns and maybe that's why I kept getting blank rows.
Thank you for brainstorming with me, Anthony!
Hi,
It sounds like there's no intersection of values between the two tables or if "C" is a string there could be a case or spaces issue.
Can I suggest loading both tables without the inner join suffix allowing Qlik to associate on "C" and then check the Data Model Viewer to get the subset ratio and distinct values on the "C" column.
You can also create some filters and debug in the UI by putting in "A","C" and "D". If you know an expected value in "C" that should have both an "A" and a "D" then the association should pick that up. If there truly is no overlap between the tables either "A" or "D" will always have dark grey when choosing a "C".
Regards
Anthony
Hi Anthony,
I tried loading both tables without inner-joining them. Table 1 and 2 are associating with each other using "C" column without me having to change the data type.
Table 1 has 48.4% as the sub-set ratio while Table 2 has 51.5%.
Table 1 has over 50K rows and Table 2 has almost 30 K rows.
I was able to solve it after using Num#() function on both C columns. I was using Num() function before and after switching to Num#() function, I didn't use it on both columns and maybe that's why I kept getting blank rows.
Thank you for brainstorming with me, Anthony!