Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sridhar_sigired
Creator
Creator

Joining the records

Hi,

As i am new to qlikview, i have basic question about joins..

 

Table A
Joining field
1
2
3
4
5
6
7

 

Table B
Joining field
7
8

9

 

Output table should be
Joining field
1
2
3
4
5
6

Which kind of join i can use to get this output? or any function?

14 Replies
sunny_talwar

May be Inner Join on Joining field

sridhar_sigired
Creator
Creator
Author

Thanks Sunny... inner join is giving result as 7.. which is common

sunny_talwar

My bad, you are right... May be Where not Exists instead of join

TableB:

LOAD Joining Field,

           ....

FROM TableB;

TableA:

LOAD Joining Field,

           ...

FROM TableA

Where Not Exists(Joining Field);

Left Join(TableA)

LOAD *

Resident TableB;

DROP Table TableB;

ramasaisaksoft

then do inner join ,later drop the field

drop field fieldName(your case 7);

neha_shirsath
Specialist
Specialist

Hi Sridhar,

Your output seems to be data from left table.

So, may be left join (Table A left join Table B)will give you the required output.

Thanks,

Neha

Not applicable

Hi,

this logic worked fine for me and it seems simple

TableB:

LOAD * INLINE [

    JoinTable

   7,

   8,

   9,

  10];

TableA:

right join

LOAD * INLINE

[

    JoinTable,

   

    1

    2

    3

    4

    5

    6

    7

]

Where not Exists(JoinTable)



hope this helps

thanks

muthukumar77
Partner - Creator III
Partner - Creator III

Try this,

T1Temp:

LOAD F1 as F1Temp;

LOAD * INLINE [

    F1

    1

    2

    3

    4

    5

    6

    7

];

Inner Join(T1Temp)

LOAD F1 as F1Temp;

LOAD * INLINE [

    F1

    7

    8

    9

];

Final:

LOAD * INLINE [

    F1

    1

    2

    3

    4

    5

    6

    7

] Where not Exists(F1Temp,F1);

Concatenate(Final)

LOAD * INLINE [

    F1

    7

    8

    9

]Where not Exists(F1Temp,F1);

DROP Table T1Temp;

Muthukumar Pandiyan
rahulpawarb
Specialist III
Specialist III

Hello Sridhar,

Trust that you are doing great!

Please refer given sample script:

[Table A]:

LOAD * INLINE [

Joining field

1

2

3

3

3

4

5

6

7

];

LEFT JOIN

[Table B]:

LOAD *, RowNo() AS RowNo INLINE [

Joining field

3

3

7

8

]

;

TableA:

LOAD DISTINCT [Joining field]

Resident [Table A]

Where Len(RowNo) = 0;

DROP Table [Table A];

Hope this will be helpful.

UPDATED: Modified the script as well as application to get desired result in case of duplicates in data set.

Regards!

Rahul

sridhar_sigired
Creator
Creator
Author

Thank you all.... unfortunately the field value may duplicate something like this.

 

Table A
Joining field
1
2
3
3
3
4
5
6
7

 

Table B
Joining field
3
3
7

8

 

Output table should be
Joining field
1
2
4
5

6

I cannot make any composite in my case... so would it be possible to get result using above? It is just sample data...