Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Joins in qlikview.

I have 2 tables with 2 fields.

Table1:

ID  Name

1    Dog

2    Cat

3    Cow

Table2:

ID Disc

1   Bark

1   Puppy

2   Meow

2   Kitten

3   Mooo

3   Calf

I want the o/p

ID   Animal

1     Dog

1     Bark

1     Puppy

2     Cat

2     Meow

2     Kitten

3     Cow

3     Mooo

3     Calf

How can I achieve this.

Thank you very much

8 Replies
robert_mika
Master III
Master III

Try this:

Table1:

load ID,

Name as Animal Inline [

ID , Name

1  ,  Dog

2 ,   Cat

3 ,   Cow

];

Table2:

LOAD ID,Disc as Animal

INLINE

[

ID, Disc

1  , Bark

1 ,  Puppy

2 ,  Meow

2 ,  Kitten

3  , Mooo

3  , Calf

]

Anonymous
Not applicable
Author

You  can  try wit  join table

Table1:

load

ID & Name  as %key

..

join(Table1)

load

ID & Disc as %Key

..

qlikviewwizard
Master II
Master II

Hi,

Try this:

Table1:

load * inline  [

ID,Name

1,Dog

2,Cat

3,Cow

];

join

Table2:

load ID,Disc as Name inline  [

ID,Disc

1, Bark

1, Puppy

2, Meow

2, Kitten

3, Mooo

3, Calf];

Capture.PNG

Anonymous
Not applicable
Author

Hi Pavana,

Robert's Solution is correct.

Similar structure tables will auto concatenate as per qlikview, field names should be renamed for fields containing similar data, you can use concatenate keyword to merge two tables as well.

Table1:

load ID,

Name as Animal Inline [

ID , Name

1  ,  Dog

2 ,   Cat

3 ,   Cow

];

Concatenate

Table2:

LOAD ID,Disc as Animal

INLINE

[

ID, Disc

1  , Bark

1 ,  Puppy

2 ,  Meow

2 ,  Kitten

3  , Mooo

3  , Calf

]

maxgro
MVP
MVP

Robert used a concatenate

Arjiun a join

and the result is the same, I think both are correct for this question

Understanding Join and Concatenate | Qlikview Cookbook

Anonymous
Not applicable
Author

As per input tables i think join is more appropriate,but as per requirement concatenate works fine.

join(its outer join and join creates various combination of records) and concatenate just merges both tables

and same number of records are displayed.

qlikviewwizard
Master II
Master II

Hi Pavana alva , Did you able to get the solution?

jsingh71
Partner - Specialist
Partner - Specialist

See attached qvw.