Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

Searching for solution.

I have worksheet with few different sheets in them.

Sheet: Main

StudentSubjectStudent#
John123
Mike223
Trout455
Nancy

654

KarlEnglish555

Sheet: Science

StudentNumberGrade
12355
22378
45567
65459

Sheet: Math

NumberGrade
12388
22392
45583
65477

As you can see header is not unique for Student number. Secondly I wanted to Merge everything in 1 table where when reading Science Sheet & Math sheet will be written to table. Below is what i want as final results.

Header 1Student#SubjectGrade
John123Science55
Mike223Science78
Trout455Science67
Nancy654Science59
John123Math88
Mike223Math92
Trout455Math83
Nancy654Math77
7 Replies
YoussefBelloum
Champion
Champion

Hi,

what do you mean header is not unique for Student Number ?

when loading Science table: rename StudentNumber as Student# and create a flag 'Science' as Subject

when loading Math table: rename StudentNumber as Student# and create a flag 'Math' as Subject

load Main table without changing anything.


this way your 3 tables will be connected by the key StudentNumber and you will have a new field Called Subject that you can use on your table the way expected above

userid128223
Creator
Creator
Author

I tried below and it did not work. Let me know what i am doing wrong.

Main:

LOAD Student,

     Subject,

     Student#

FROM

[Book1.xlsx]

(ooxml, embedded labels, table is Main);

Left Join (Main)

LOAD StudentNumber as Student#,

     'Math' as Subject,

     Grade

FROM

[Book1.xlsx]

(ooxml, embedded labels, table is Math);

YoussefBelloum
Champion
Champion

do you get an error message ?

maybe you don't have the field Subject on the main table or it is null, anyway, just remove it from the main table load and try again

userid128223
Creator
Creator
Author

Error field Subject not found. It did not work when subject field was empty. It did not work when i populated subject with 1 field.

userid128223
Creator
Creator
Author

what if i want to keep subject field in first table. How can i make this work.

MarcoWedel

Hi,

maybe one solution could be:

QlikCommunity_Thread_315776_Pic1.JPG

tabMain:

LOAD StudentNumber as Student#,

    'Science' as Subject,

    Grade

FROM [https://community.qlik.com/thread/315776] (html, codepage is 1252, embedded labels, table is @2);

LOAD Number as Student#,

    'Math' as Subject,

    Grade

FROM [https://community.qlik.com/thread/315776] (html, codepage is 1252, embedded labels, table is @3);

Join

LOAD Student,

    Student#

FROM [https://community.qlik.com/thread/315776] (html, codepage is 1252, embedded labels, table is @1);

hope this helps

regards

Marco

MarcoWedel

What about Karl and his English class from your Main table?

You didn't expect him to be present in your final result table, but still want to keep the subject field from the Main table?

Can you describe how this result would look like, i.e. other than your initial final result?