Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

Append data on left join

How do you append data in following scenario while doing left join?

Sheet: Main

StudentNameSubjectStudent#
John123
Mike223
Trout455
Nancy

654

KarlEnglish555

Sheet: Science

Student#SubjectGrade
123Science55
223Science78
455Math67
654Math59
1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Are you looking for this? If yes try below:

Capture.PNG

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;

View solution in original post

4 Replies
userid128223
Creator
Creator
Author

any ideas?

vishsaggi
Champion III
Champion III

Are you looking for this? If yes try below:

Capture.PNG

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;

userid128223
Creator
Creator
Author

Is this full proof. What if second table has nulls then what happens. Would it get wrong subject.

vishsaggi
Champion III
Champion III

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.