Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do you append data in following scenario while doing left join?
Sheet: Main
StudentName | Subject | Student# |
---|---|---|
John | 123 | |
Mike | 223 | |
Trout | 455 | |
Nancy | 654 | |
Karl | English | 555 |
Sheet: Science
Student# | Subject | Grade |
---|---|---|
123 | Science | 55 |
223 | Science | 78 |
455 | Math | 67 |
654 | Math | 59 |
Are you looking for this? If yes try below:
Main:
LOAD StudentName,
Subject,
Student#
FROM
[https://community.qlik.com/thread/315806]
(html, codepage is 1252, embedded labels, table is @1);
Left Join(Main)
LOAD Student#,
Subject AS Subject1,
Grade
FROM
[https://community.qlik.com/thread/315806]
(html, codepage is 1252, embedded labels, table is @2);
NoConcatenate
Science:
LOAD *,
IF(ISNULL(Subject1), Subject, Subject1) AS FinalSubject
Resident Main;
Drop Table Main;
Drop Fields Subject, Subject1;
any ideas?
Are you looking for this? If yes try below:
Main:
LOAD StudentName,
Subject,
Student#
FROM
[https://community.qlik.com/thread/315806]
(html, codepage is 1252, embedded labels, table is @1);
Left Join(Main)
LOAD Student#,
Subject AS Subject1,
Grade
FROM
[https://community.qlik.com/thread/315806]
(html, codepage is 1252, embedded labels, table is @2);
NoConcatenate
Science:
LOAD *,
IF(ISNULL(Subject1), Subject, Subject1) AS FinalSubject
Resident Main;
Drop Table Main;
Drop Fields Subject, Subject1;
Is this full proof. What if second table has nulls then what happens. Would it get wrong subject.
So there is as possibility that you will have missing subjects in both the tables? So you will get Nulls if you have that for those subjects and it will display only Nulls for those matching Student# and subject.
Try like below:
IF(ISNULL(Subject1), Subject, Subject1)
IF this does not work can you send some data with that scenario and also your expected output.