Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combine tables without common entry

Hi Team,

I have two table :

Table1: Holds all employee details without  0 planning hours(<>0)

Table2: Hold all employees with zero planning hours.(=0)

Fileds name-Employee name,Project code,week,planning hours.

So there are chances that employees in table 1 may be in table 2 for some week.

Hence, I wont a table which holds data from table1 and table 2 but make sure

In case there are same employee in table1 and table2 , we should keep the one in table 1(<>0).

Kindly assist.

Thanks,

Prajna

10 Replies
muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Can you send expected output?

by Sample Data

Muthukumar Pandiyan
Not applicable
Author

Table1:

Prajna,P1,W1,8

Prajna,P2,W1,3

Table2:

Prajna,P3,W1,0

Ramya,P1,w1,0

Output:

Prajna,P1,W1,8

Prajna,P2,W1,3

Ramya,P1,W1,0

Thanks,

Prajna

jonathandienst
Partner - Champion III
Partner - Champion III

Like this:

LOAD [Employee name],[Project code],week,[planning hours]

FROM Table1;

Concatenate

LOAD [Employee name],[Project code],week,[planning hours]

FROM Table2

Where not(Exists([Employee name]);


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
PrashantSangle

Hi,

As Jonathan suggest you can use concatenate but if you have common entry in both table and you want only single entry of it then use join i.e. outer join

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
muthukumar77
Partner - Creator III
Partner - Creator III

Table:

LOAD [Employee name],[Project code],week,[planning hours]

FROM Table1;

Concatenate(T1)

LOAD [Employee name],[Project code],week,[planning hours]

FROM Table2 Where not(Exists([Employee name]);

Muthukumar Pandiyan
Not applicable
Author

Hi Prajna,

[Employee name] may not be enough in you case so if you need you can create key field and use it in Exists function:

LOAD Employee,

     Project,

     Week,

     [Planning hours],

     Employee&Project&Week as %Key

FROM Table1;

LOAD Employee,

     Project,

     Week,

     [Planning hours],

     Employee&Project&Week as %Key

FROM Table2

Where Not Exists (%Key,Employee&Project&Week);

BR,

Milosz

Not applicable
Author

I added you script but where not exists doesnt seem to highlight

PrashantSangle

Hi,

try Milosz script it will work

In Jonathan script there are bracket missing if you correct it then it also work for you

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Relove the parenthesis between not and Exists